Jump to content

[11935][Patch] Modify morph command modification


Guest MacWarriors

Recommended Posts

What bug does the patch fix? What features does the patch add?

Prevent using wrong display in .modify morph command

For which repository revision was the patch created?

11781

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

No

Who has been writing this patch? Please include either forum user names or email addresses.

Me

Description

At this time, .modify morph command allow using wrong displayID, with this patch, it won't.

Patch

http://pastebin.com/nGH1iuZz

diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 0fbfab1..a6bfaef 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -2453,6 +2453,14 @@ bool ChatHandler::HandleModifyMorphCommand(char* args)

    uint16 display_id = (uint16)atoi(args);

+    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();

Best regards,

MacWarrior.

Link to comment
Share on other sites

  • 7 months later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use