Skip to content

Commit

Permalink
🔧 Make ODEF collmesh with empty name non-fatal.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp authored and Petr Ohlídal committed Apr 9, 2021
1 parent 7f98743 commit 2669a74
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/main/terrain/TerrainObjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,14 @@ void TerrainObjectManager::LoadTerrainObject(const Ogre::String& name, const Ogr

for (ODefCollisionMesh& cmesh : odef->collision_meshes)
{
if (cmesh.mesh_name == "")
{
App::GetConsole()->putMessage(
Console::CONSOLE_MSGTYPE_TERRN, Console::CONSOLE_SYSTEM_WARNING,
"ODEF: Skipping collision mesh with empty name");
continue;
}

auto gm = terrainManager->GetCollisions()->getGroundModelByString(cmesh.groundmodel_name);
terrainManager->GetCollisions()->addCollisionMesh(
cmesh.mesh_name, pos, tenode->getOrientation(),
Expand Down

0 comments on commit 2669a74

Please # to comment.