1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-04 17:57:47 +00:00

gracefully crash the server if no navmeshes exist with a useful error

This commit is contained in:
NotAdam 2019-04-29 19:59:19 +10:00
parent 3e4483053e
commit 2b217a545b
2 changed files with 8 additions and 1 deletions

View file

@ -66,8 +66,9 @@ bool Sapphire::World::Manager::TerritoryMgr::init()
createDefaultTerritories(); createDefaultTerritories();
createHousingTerritories(); createHousingTerritories();
} }
catch( std::runtime_error& ) catch( const std::runtime_error& ex )
{ {
Logger::fatal( "Caught exception during territory init: {}", ex.what() );
return false; return false;
} }

View file

@ -136,6 +136,12 @@ bool Sapphire::Zone::init()
m_pNaviProvider = pNaviMgr->getNaviProvider( m_territoryTypeInfo->bg ); m_pNaviProvider = pNaviMgr->getNaviProvider( m_territoryTypeInfo->bg );
if( !m_pNaviProvider )
{
Logger::fatal( "No navmesh found for TerritoryType#{}", getTerritoryTypeId() );
throw std::runtime_error( "Missing navmesh file(s)." );
}
return true; return true;
} }