Browse Source

vcmi: fix terrain penalties

Fixes #2028
Konstantin P 2 years ago
parent
commit
d94ce22e70
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/mapObjects/CGHeroInstance.cpp

+ 1 - 1
lib/mapObjects/CGHeroInstance.cpp

@@ -76,7 +76,7 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile & dest, const TerrainTile & f
 			!ti->hasBonusOfType(Bonus::NO_TERRAIN_PENALTY, from.terType->getIndex())) //no special movement bonus
 	{
 
-		ret = VLC->heroh->terrCosts[from.terType->getId()];
+		ret = VLC->terrainTypeHandler->getById(dest.terType->getId())->moveCost;
 		ret -= ti->valOfBonuses(Bonus::ROUGH_TERRAIN_DISCOUNT);
 		if(ret < GameConstants::BASE_MOVEMENT_COST)
 			ret = GameConstants::BASE_MOVEMENT_COST;