more null checks in places where we're calling createAppearance; some cleanup

This commit is contained in:
DarthArgus
2016-01-07 22:05:32 -06:00
parent 1ad5f8d882
commit 1d67bdd186
7 changed files with 95 additions and 51 deletions
@@ -835,12 +835,16 @@ void GameServer::loadTerrain ()
TerrainObject * const terrainObject = new TerrainObject(ServerWorld::getTerrainObjectNotification());
terrainObject->setDebugName("terrain");
Appearance * const appearance = AppearanceTemplateList::createAppearance(terrainFileName);
terrainObject->setAppearance(appearance);
if (appearance != NULL) {
terrainObject->setAppearance(appearance);
}
ProceduralTerrainAppearance * const proceduralTerrainAppearance = dynamic_cast<ProceduralTerrainAppearance *>(appearance);
if (proceduralTerrainAppearance)
if (proceduralTerrainAppearance) {
ServerObjectTerrainModificationNotification::setTerrainAppearance(proceduralTerrainAppearance);
}
terrainObject->addToWorld();
}