Browse files

[11935] Check display Id for .modify morph command

Signed-off-by: Schmoozerd <>
  • Loading branch information...
1 parent 926f18e commit 5273e01030e63456ddb8c2f048b1a419a8d3b1ff MacWarriors committed with Schmoozerd Mar 29, 2012
Showing with 11 additions and 3 deletions.
  1. +10 −2 src/game/Level2.cpp
  2. +1 −1 src/shared/revision_nr.h
12 src/game/Level2.cpp
@@ -2453,9 +2453,17 @@ bool ChatHandler::HandleModifyMorphCommand(char* args)
if (!*args)
return false;
- uint16 display_id = (uint16)atoi(args);
+ uint32 display_id = (uint32)atoi(args);
- Unit *target = getSelectedUnit();
+ CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(display_id);
+ if (!displayEntry)
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+ Unit* target = getSelectedUnit();
if (!target)
target = m_session->GetPlayer();
2 src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "11934"
+ #define REVISION_NR "11935"
#endif // __REVISION_NR_H__

5 comments on commit 5273e01


You should also add a security for display which make the game crash ( 15444, 17116, 15331, 15332 )


it is very possible that there are other display ids which also cause a client crash (I assume it is client only?)
So listing them is maybe no great idea - possible there is a better solution,
but I really think this is low priority, after all this is only relevant for a gamemaster command, and they should use it only in brain-on mode :)


To answer your question, yes, they only crash client.
I've been testing all 3.3.5a displayID and those ones are the only which make the client crash.
But I agree with you, this is low priority.

For information, somme gameobjects displayId make the client and the server crash.


if these are really the only ones, it might indeed be worth filtering them.
Maybe they also should be filtered genericly

About the GOs: More information welcome :)


GOBs displayID : 3111(wmo), 7424(wmo), 7667(wmo), 5631(lost this one, but might me wmo too)
They crash the client for sure, and I remember that some make the server crash, like 7667 if I remember correctly.

As for the NPC displayID, I've been testing all GOB displayid.

Please sign in to comment.