From 9399bcc15de223620ca55495c7c25210139c1ae8 Mon Sep 17 00:00:00 2001 From: Dydzio Date: Wed, 13 Sep 2023 18:54:08 +0200 Subject: [PATCH] Fix pathfinder tile cost --- lib/mapObjects/CGHeroInstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index c7e2700b6..4b77c2546 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -79,7 +79,7 @@ ui32 CGHeroInstance::getTileMovementCost(const TerrainTile & dest, const Terrain !ti->hasBonusOfType(BonusType::NO_TERRAIN_PENALTY, from.terType->getIndex())) //no special movement bonus { - ret = VLC->terrainTypeHandler->getById(dest.terType->getId())->moveCost; + ret = VLC->terrainTypeHandler->getById(from.terType->getId())->moveCost; ret -= ti->valOfBonuses(BonusType::ROUGH_TERRAIN_DISCOUNT); if(ret < GameConstants::BASE_MOVEMENT_COST) ret = GameConstants::BASE_MOVEMENT_COST;