mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Added workaround for random objects on water, fixes 1828
This commit is contained in:
parent
05d8fad314
commit
c0e4591bc7
@ -191,7 +191,10 @@ void CGObjectInstance::setType(si32 ID, si32 subID)
|
||||
//recalculate blockvis tiles - new appearance might have different blockmap than before
|
||||
cb->gameState()->map->removeBlockVisTiles(this, true);
|
||||
auto handler = VLC->objtypeh->getHandlerFor(ID, subID);
|
||||
appearance = handler->getTemplates(tile.terType).at(0);
|
||||
if (!handler->getTemplates(tile.terType).empty())
|
||||
appearance = handler->getTemplates(tile.terType)[0];
|
||||
else
|
||||
appearance = handler->getTemplates()[0]; // get at least some appearance since alternative is crash
|
||||
cb->gameState()->map->addBlockVisTiles(this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user