|
@@ -1479,6 +1479,7 @@ void NewObject::applyGs(CGameState *gs)
|
|
terrainType = t.terType->getId();
|
|
terrainType = t.terType->getId();
|
|
|
|
|
|
auto handler = VLC->objtypeh->getHandlerFor(ID, subID);
|
|
auto handler = VLC->objtypeh->getHandlerFor(ID, subID);
|
|
|
|
+
|
|
CGObjectInstance * o = handler->create();
|
|
CGObjectInstance * o = handler->create();
|
|
handler->configureObject(o, gs->getRandomGenerator());
|
|
handler->configureObject(o, gs->getRandomGenerator());
|
|
|
|
|
|
@@ -1496,6 +1497,11 @@ void NewObject::applyGs(CGameState *gs)
|
|
}
|
|
}
|
|
|
|
|
|
assert(!handler->getTemplates(terrainType).empty());
|
|
assert(!handler->getTemplates(terrainType).empty());
|
|
|
|
+ if (handler->getTemplates().empty())
|
|
|
|
+ {
|
|
|
|
+ logGlobal->error("Attempt to create object (%d %d) with no templates!", ID, subID);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
if (!handler->getTemplates(terrainType).empty())
|
|
if (!handler->getTemplates(terrainType).empty())
|
|
o->appearance = handler->getTemplates(terrainType).front();
|
|
o->appearance = handler->getTemplates(terrainType).front();
|