diff options
author | megamage <none@none> | 2009-05-19 15:26:43 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-19 15:26:43 -0500 |
commit | 68c1d0feab7a050a92975397e847edeae4e2b27b (patch) | |
tree | 2b0156f6b1697e0de359b676f6c48e5085b0ab4c /src/game/Debugcmds.cpp | |
parent | 73157c831480f731f7e115cd3b2c2d05dc650eee (diff) |
*Allow send gobject guid in send opcode command.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Debugcmds.cpp')
-rw-r--r-- | src/game/Debugcmds.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index 2e3a256a214..fdc26faf5bc 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -198,6 +198,40 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(const char* /*args*/) { data.append(player->GetPackGUID()); } + else if(type == "appgoguid") + { + uint32 lowguid; + ifs >> lowguid; + GameObject *obj = NULL; + if (GameObjectData const* go_data = objmgr.GetGOData(lowguid)) + obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); + + if(!obj) + { + PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, lowguid); + SetSentErrorMessage(true); + ifs.close(); + return false; + } + data.append(obj->GetPackGUID()); + } + else if(type == "goguid") + { + uint32 lowguid; + ifs >> lowguid; + GameObject *obj = NULL; + if (GameObjectData const* go_data = objmgr.GetGOData(lowguid)) + obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id); + + if(!obj) + { + PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, lowguid); + SetSentErrorMessage(true); + ifs.close(); + return false; + } + data << uint64(obj->GetGUID()); + } else if(type == "myguid") { data << uint64(player->GetGUID()); |