fix(Core/Command): crash on set model to npc if not valid (#4874)
This commit is contained in:
@@ -21,6 +21,7 @@ EndScriptData */
|
|||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||||
#include "Transport.h"
|
#include "Transport.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
struct NpcFlagText
|
struct NpcFlagText
|
||||||
{
|
{
|
||||||
@@ -922,6 +923,13 @@ public:
|
|||||||
return false;
|
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->SetDisplayId(displayId);
|
||||||
creature->SetNativeDisplayId(displayId);
|
creature->SetNativeDisplayId(displayId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user