mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
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 "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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user