aboutsummaryrefslogtreecommitdiff
path: root/src/game/Debugcmds.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-24 21:06:12 -0600
committermegamage <none@none>2009-02-24 21:06:12 -0600
commit8770a90bc6389d123a2716079bde40f43fc26357 (patch)
tree21895306cfd4f7f2757b60917a2b478f77d5af1e /src/game/Debugcmds.cpp
parent0f9afd76a1308635d0dfbcffe054bf0224324251 (diff)
*Update of some debug command.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Debugcmds.cpp')
-rw-r--r--src/game/Debugcmds.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp
index c0f673a539a..3bf64188e34 100644
--- a/src/game/Debugcmds.cpp
+++ b/src/game/Debugcmds.cpp
@@ -132,8 +132,12 @@ bool ChatHandler::HandleBuyErrorCommand(const char* args)
bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
{
Unit *unit = getSelectedUnit();
+ Player *player = NULL;
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
- unit = m_session->GetPlayer();
+ player = m_session->GetPlayer();
+ else
+ player = (Player*)unit;
+ if(!unit) unit = player;
std::ifstream ifs("opcode.txt");
if(ifs.bad())
@@ -192,6 +196,22 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
{
data.append(unit->GetPackGUID());
}
+ else if(type == "myguid")
+ {
+ data.append(player->GetPackGUID());
+ }
+ else if(type == "pos")
+ {
+ data << unit->GetPositionX();
+ data << unit->GetPositionY();
+ data << unit->GetPositionZ();
+ }
+ else if(type == "mypos")
+ {
+ data << player->GetPositionX();
+ data << player->GetPositionY();
+ data << player->GetPositionZ();
+ }
else
{
sLog.outDebug("Sending opcode: unknown type '%s'", type.c_str());