mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +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
This commit is contained in:
@@ -340,7 +340,7 @@ enum TrinityStrings
|
||||
LANG_COMMAND_MODIFY_ARENA = 306,
|
||||
LANG_COMMAND_FACTION_NOTFOUND = 307,
|
||||
LANG_COMMAND_FACTION_UNKNOWN = 308,
|
||||
LANG_COMMAND_FACTION_INVPARAM = 309,
|
||||
LANG_COMMAND_INVALID_PARAM = 309,
|
||||
LANG_COMMAND_FACTION_DELTA = 310,
|
||||
LANG_FACTION_LIST = 311,
|
||||
LANG_FACTION_VISIBLE = 312,
|
||||
|
||||
@@ -770,7 +770,7 @@ public:
|
||||
}
|
||||
if (r >= MAX_REPUTATION_RANK)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_INVPARAM, rankTxt);
|
||||
handler->PSendSysMessage(LANG_COMMAND_INVALID_PARAM, rankTxt);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -837,6 +837,13 @@ public:
|
||||
handler->SetSentErrorMessage(true);
|
||||
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