1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

TurnInfo: add cache for bonuses selection

This commit is contained in:
ArseniyShestakov
2015-11-20 12:28:35 +03:00
parent d19cb5ce89
commit cb61572878

View File

@@ -711,7 +711,10 @@ bool CPathfinder::addTeleportWhirlpool(const CGWhirlpool * obj) const
TurnInfo::TurnInfo(const CGHeroInstance * Hero, const int turn)
: hero(Hero), maxMovePointsLand(-1), maxMovePointsWater(-1)
{
bonuses = hero->getAllBonuses(Selector::days(turn), nullptr);
std::stringstream cachingStr;
cachingStr << "days_" << turn;
bonuses = hero->getAllBonuses(Selector::days(turn), nullptr, nullptr, cachingStr.str());
}
bool TurnInfo::isLayerAvailable(const EPathfindingLayer layer) const