1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Rework and optimize turnInfo used by pathfinder

This commit is contained in:
Ivan Savenko
2024-12-28 12:02:27 +00:00
parent 579b64cd39
commit dea1eba20b
16 changed files with 300 additions and 273 deletions

View File

@@ -584,7 +584,7 @@ std::vector<SetMovePoints> NewTurnProcessor::updateHeroesMovementPoints()
{
for (CGHeroInstance *h : elem.second.getHeroes())
{
auto ti = std::make_unique<TurnInfo>(h, 1);
auto ti = h->getTurnInfo(1);
// NOTE: this code executed when bonuses of previous day not yet updated (this happen in NewTurn::applyGs). See issue 2356
int32_t newMovementPoints = h->movementPointsLimitCached(gameHandler->gameState()->map->getTile(h->visitablePos()).isLand(), ti.get());