1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Some nontrivial optimizations based on profiling results:

- Movement bonuses will be calculated ONCE per pathfinder loop
- Goals will be sorted by hero to reduce number of calculatePaths calls
This commit is contained in:
DjWarmonger
2014-03-31 14:26:09 +00:00
parent 8683c8c0eb
commit a64df5718f
6 changed files with 27 additions and 12 deletions

View File

@@ -353,7 +353,7 @@ bool CCallback::getPath2( int3 dest, CGPath &ret )
int CCallback::getMovementCost(const CGHeroInstance * hero, int3 dest)
{
return gs->getMovementCost(hero, hero->visitablePos(), dest, hero->movement);
return gs->getMovementCost(hero, hero->visitablePos(), dest, hero->hasBonusOfType (Bonus::FLYING_MOVEMENT), hero->movement);
}
void CCallback::recalculatePaths()