1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Merge pull request #2823 from dydzio0614/pathfinder-tile-cost

Fix pathfinder tile cost
This commit is contained in:
Ivan Savenko 2023-09-13 22:50:04 +03:00 committed by GitHub
commit 248afa523d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;