1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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

@@ -128,13 +128,13 @@ void CGObjectInstance::setType(MapObjectID newID, MapObjectSubID newSubID)
cb->gameState()->map->removeBlockVisTiles(this, true);
auto handler = VLC->objtypeh->getHandlerFor(newID, newSubID);
if(!handler->getTemplates(tile.terType->getId()).empty())
if(!handler->getTemplates(tile.getTerrainID()).empty())
{
appearance = handler->getTemplates(tile.terType->getId())[0];
appearance = handler->getTemplates(tile.getTerrainID())[0];
}
else
{
logGlobal->warn("Object %d:%d at %s has no templates suitable for terrain %s", newID, newSubID, visitablePos().toString(), tile.terType->getNameTranslated());
logGlobal->warn("Object %d:%d at %s has no templates suitable for terrain %s", newID, newSubID, visitablePos().toString(), tile.getTerrain()->getNameTranslated());
appearance = handler->getTemplates()[0]; // get at least some appearance since alternative is crash
}