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

"!add bnpc" no longer crashes world.exe if a non-existing bnpctemplate is inputted

This commit is contained in:
JeidoUran 2019-01-04 05:12:06 +01:00
parent 71f2542c9f
commit a4f54d2b31

View file

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