aboutsummaryrefslogtreecommitdiff
path: root/src/game/Debugcmds.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-21 09:59:49 -0500
committermegamage <none@none>2009-05-21 09:59:49 -0500
commit40c58e599296203072c834fde68094b9544abaa6 (patch)
tree002823d80bc6dc66aafb32e79ef3cf6260c1fb48 /src/game/Debugcmds.cpp
parenta77f9e209234706931bb8433e2c18b336306aab2 (diff)
*Allow use gm command to set value for gobjects.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Debugcmds.cpp')
-rw-r--r--src/game/Debugcmds.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp
index fdc26faf5bc..356b2c25ca2 100644
--- a/src/game/Debugcmds.cpp
+++ b/src/game/Debugcmds.cpp
@@ -200,15 +200,10 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(const char* /*args*/)
}
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);
-
+ GameObject *obj = GetNearbyGameObject();
if(!obj)
{
- PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, lowguid);
+ PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, 0);
SetSentErrorMessage(true);
ifs.close();
return false;
@@ -217,15 +212,10 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(const char* /*args*/)
}
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);
-
+ GameObject *obj = GetNearbyGameObject();
if(!obj)
{
- PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, lowguid);
+ PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, 0);
SetSentErrorMessage(true);
ifs.close();
return false;