fix(Core/Command): crash on set model to npc if not valid (#4874)
This commit is contained in:
parent
00f7a6bbde
commit
edd6d65fb2
1 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ EndScriptData */
|
|||
#include "ScriptMgr.h"
|
||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||
#include "Transport.h"
|
||||
#include <string>
|
||||
|
||||
struct NpcFlagText
|
||||
{
|
||||
|
|
@ -922,6 +923,13 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!sCreatureDisplayInfoStore.LookupEntry(displayId))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_INVPARAM, std::to_string(displayId).c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
creature->SetDisplayId(displayId);
|
||||
creature->SetNativeDisplayId(displayId);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue