mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Scripts/Commands: Fix crash caused by .set npc model (#22877)
* Scripts/Commands: Fix crash caused by .set npc model
Fix crash caused by .set npc model with invalid model id
(cherry picked from commit 20ea24bf5c)
This commit is contained in:
@@ -734,7 +734,7 @@ public:
|
||||
|
||||
if (rankThresholdItr == end)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_INVPARAM, rankTxt);
|
||||
handler->PSendSysMessage(LANG_COMMAND_INVALID_PARAM, rankTxt);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -879,6 +879,13 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sCreatureDisplayInfoStore.LookupEntry(displayId))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_INVALID_PARAM, args);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
creature->SetDisplayId(displayId);
|
||||
creature->SetNativeDisplayId(displayId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user