From 2669a7498aba0161fe2fa69100bcff1c65a5b058 Mon Sep 17 00:00:00 2001 From: Petr Ohlidal Date: Thu, 8 Apr 2021 20:49:40 +0200 Subject: [PATCH] :wrench: Make ODEF collmesh with empty name non-fatal. --- source/main/terrain/TerrainObjectManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/main/terrain/TerrainObjectManager.cpp b/source/main/terrain/TerrainObjectManager.cpp index b97695e3b6..9b1eefedd5 100644 --- a/source/main/terrain/TerrainObjectManager.cpp +++ b/source/main/terrain/TerrainObjectManager.cpp @@ -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(),