1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Converted terrainTypeHandler into proper handler class

This commit is contained in:
Ivan Savenko
2022-12-20 16:14:06 +02:00
parent 01811317f9
commit 1468f6aded
43 changed files with 410 additions and 590 deletions

View File

@@ -121,7 +121,7 @@ void Object::Instance::setTemplate(TerrainId terrain)
auto templates = VLC->objtypeh->getHandlerFor(dObject.ID, dObject.subID)->getTemplates(terrain);
if (templates.empty())
{
auto terrainName = VLC->terrainTypeHandler->terrains()[terrain].name;
auto terrainName = VLC->terrainTypeHandler->getById(terrain)->name;
throw rmgException(boost::to_string(boost::format("Did not find graphics for object (%d,%d) at %s") % dObject.ID % dObject.subID % terrainName));
}
dObject.appearance = templates.front();