1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

Merge pull request #469 from JeidoUran/crashes_fix

"!add bnpc" no longer crashes world.exe if a non-existing bnpctemplate is inputted
This commit is contained in:
Adam 2019-01-05 00:03:52 +11:00 committed by GitHub
commit c09333c96a

View file

@ -428,8 +428,10 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
auto bNpcTemplate = serverZone->getBNpcTemplate( params );
if( !bNpcTemplate )
{
player.sendNotice( "Template " + params + " not found in cache!" );
return;
}
auto pBNpc = std::make_shared< Entity::BNpc >( bNpcTemplate,
player.getPos().x,
player.getPos().y,
@ -1041,4 +1043,4 @@ void Sapphire::World::Manager::DebugCommandMgr::housing( char* data, Entity::Pla
{
player.sendDebug( "Unknown sub command." );
}
}
}