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

Provide more information in thrown exceptions for unfixed crashes

This commit is contained in:
Ivan Savenko
2024-04-22 16:40:43 +03:00
parent 82b921d852
commit 5454d01316
4 changed files with 17 additions and 8 deletions

View File

@@ -133,11 +133,7 @@ void CGObjectInstance::setType(MapObjectID newID, MapObjectSubID newSubID)
//recalculate blockvis tiles - new appearance might have different blockmap than before
cb->gameState()->map->removeBlockVisTiles(this, true);
auto handler = VLC->objtypeh->getHandlerFor(newID, newSubID);
if(!handler)
{
logGlobal->error("Unknown object type %d:%d at %s", newID, newSubID, visitablePos().toString());
return;
}
if(!handler->getTemplates(tile.terType->getId()).empty())
{
appearance = handler->getTemplates(tile.terType->getId())[0];