1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

TerrainTile now uses identifiers instead of pointers to VLC

This commit is contained in:
Ivan Savenko
2024-07-13 18:37:13 +00:00
parent a518b76c79
commit 08fbcd5239
44 changed files with 237 additions and 194 deletions

View File

@ -291,14 +291,12 @@ AudioPath HeroMovementController::getMovementSoundFor(const CGHeroInstance * her
auto prevTile = LOCPLINT->cb->getTile(posPrev);
auto nextTile = LOCPLINT->cb->getTile(posNext);
auto prevRoad = prevTile->roadType;
auto nextRoad = nextTile->roadType;
bool movingOnRoad = prevRoad->getId() != Road::NO_ROAD && nextRoad->getId() != Road::NO_ROAD;
bool movingOnRoad = prevTile->hasRoad() && nextTile->hasRoad();
if(movingOnRoad)
return nextTile->terType->horseSound;
return nextTile->getTerrain()->horseSound;
else
return nextTile->terType->horseSoundPenalty;
return nextTile->getTerrain()->horseSoundPenalty;
};
void HeroMovementController::updateMovementSound(const CGHeroInstance * h, int3 posPrev, int3 nextCoord, EPathNodeAction moveType)