mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Store TerrainType by havlue and handle by reference
This commit is contained in:
@@ -346,7 +346,7 @@ CHeroHandler::CHeroHandler()
|
||||
loadTerrains();
|
||||
for(int i = 0; i < VLC->terrainTypeHandler->terrains().size(); ++i)
|
||||
{
|
||||
VLC->modh->identifiers.registerObject("core", "terrain", VLC->terrainTypeHandler->terrains()[i]->name, i);
|
||||
VLC->modh->identifiers.registerObject("core", "terrain", VLC->terrainTypeHandler->terrains()[i].name, i);
|
||||
}
|
||||
loadBallistics();
|
||||
loadExperience();
|
||||
@@ -972,9 +972,9 @@ ui64 CHeroHandler::reqExp (ui32 level) const
|
||||
|
||||
void CHeroHandler::loadTerrains()
|
||||
{
|
||||
for(const auto * terrain : VLC->terrainTypeHandler->terrains())
|
||||
for(const auto & terrain : VLC->terrainTypeHandler->terrains())
|
||||
{
|
||||
terrCosts[terrain->id] = terrain->moveCost;
|
||||
terrCosts[terrain.id] = terrain.moveCost;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user