|
@@ -1539,8 +1539,10 @@ void CGameHandler::newTurn()
|
|
|
|
|
|
NewTurn::Hero hth;
|
|
|
hth.id = h->id;
|
|
|
+ auto ti = new TurnInfo(h, 1);
|
|
|
// TODO: this code executed when bonuses of previous day not yet updated (this happen in NewTurn::applyGs). See issue 2356
|
|
|
- hth.move = h->maxMovePoints(gs->map->getTile(h->getPosition(false)).terType != ETerrainType::WATER, new TurnInfo(h, 1));
|
|
|
+ hth.move = h->maxMovePoints(gs->map->getTile(h->getPosition(false)).terType != ETerrainType::WATER, ti);
|
|
|
+ delete ti;
|
|
|
hth.mana = h->getManaNewTurn();
|
|
|
|
|
|
n.heroes.insert(hth);
|
|
@@ -1996,6 +1998,7 @@ bool CGameHandler::moveHero( ObjectInstanceID hid, int3 dst, ui8 teleporting, bo
|
|
|
const bool canFly = ti->hasBonusOfType(Bonus::FLYING_MOVEMENT);
|
|
|
const bool canWalkOnSea = ti->hasBonusOfType(Bonus::WATER_WALKING);
|
|
|
const int cost = CPathfinderHelper::getMovementCost(h, h->getPosition(), hmpos, nullptr, nullptr, h->movement, ti);
|
|
|
+ delete ti;
|
|
|
|
|
|
//it's a rock or blocked and not visitable tile
|
|
|
//OR hero is on land and dest is water and (there is not present only one object - boat)
|