diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Debugcmds.cpp | 22 | ||||
-rw-r--r-- | src/game/Level3.cpp | 16 |
2 files changed, 29 insertions, 9 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()); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 6a909d447ba..0dd5c7a176d 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -6433,22 +6433,22 @@ when attempting to use the PointMovementGenerator */ bool ChatHandler::HandleComeToMeCommand(const char *args) { - Creature* caster = getSelectedCreature(); + char* newFlagStr = strtok((char*)args, " "); + if(!newFlagStr) + return false; + + uint32 newFlags = (uint32)strtoul(newFlagStr, NULL, 0); + + Creature* caster = getSelectedCreature(); if(!caster) { + m_session->GetPlayer()->SetUnitMovementFlags(newFlags); SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); return false; } - char* newFlagStr = strtok((char*)args, " "); - - if(!newFlagStr) - return false; - - uint32 newFlags = atoi(newFlagStr); - caster->SetUnitMovementFlags(newFlags); Player* pl = m_session->GetPlayer(); |