mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Minor optimizations
This commit is contained in:
@@ -68,11 +68,12 @@ Path Path::search(const Tileset & dst, bool straight, std::function<float(const
|
||||
if(!dArea)
|
||||
return Path::invalid();
|
||||
|
||||
if(dst.empty()) // Skip construction of same area
|
||||
return Path(*dArea);
|
||||
|
||||
auto resultArea = *dArea + dst;
|
||||
Path result(resultArea);
|
||||
if(dst.empty())
|
||||
return result;
|
||||
|
||||
|
||||
int3 src = rmg::Area(dst).nearest(dPath);
|
||||
result.connect(src);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user