Fix a crash when using an invalid display id with command ``npc set model
``.
This commit is contained in:
parent
f223312364
commit
95444d1202
@ -671,6 +671,13 @@ bool ChatHandler::HandleNpcSetModelCommand(char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sCreatureDisplayInfoStore.LookupEntry(displayId))
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
pCreature->SetDisplayId(displayId);
|
||||
pCreature->SetNativeDisplayId(displayId);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user