mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +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:
commit
c09333c96a
1 changed files with 4 additions and 2 deletions
|
@ -428,8 +428,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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue