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

Move base movement cost to GameConstants

This commit is contained in:
ArseniyShestakov 2015-10-16 03:03:40 +03:00
parent 3466e0fae7
commit 226650582d
2 changed files with 5 additions and 3 deletions

View File

@ -51,6 +51,7 @@ namespace GameConstants
const int SPELLS_QUANTITY=70;
const int CREATURES_COUNT = 197;
const ui32 BASE_MOVEMENT_COST = 100; //default cost for non-diagonal movement
}
class CArtifact;

View File

@ -58,8 +58,7 @@ static int lowestSpeed(const CGHeroInstance * chi)
ui32 CGHeroInstance::getTileCost(const TerrainTile &dest, const TerrainTile &from) const
{
//base move cost
unsigned ret = 100;
unsigned ret = GameConstants::BASE_MOVEMENT_COST;
//if there is road both on dest and src tiles - use road movement cost
if(dest.roadType != ERoadType::NO_ROAD && from.roadType != ERoadType::NO_ROAD)
@ -95,7 +94,9 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile &dest, const TerrainTile &fro
{
ret = VLC->heroh->terrCosts[from.terType];
ret -= getSecSkillLevel(SecondarySkill::PATHFINDING) * 25;
ret = ret < 100 ? 100 : ret;
if(ret < GameConstants::BASE_MOVEMENT_COST)
ret = GameConstants::BASE_MOVEMENT_COST;
break;
}
}