aboutsummaryrefslogtreecommitdiff
path: root/src/game/Debugcmds.cpp
diff options
context:
space:
mode:
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;