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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user