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