*Update of some debug command.
--HG-- branch : trunk
This commit is contained in:
+21
-1
@@ -132,8 +132,12 @@ bool ChatHandler::HandleBuyErrorCommand(const char* args)
|
|||||||
bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
|
bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
|
||||||
{
|
{
|
||||||
Unit *unit = getSelectedUnit();
|
Unit *unit = getSelectedUnit();
|
||||||
|
Player *player = NULL;
|
||||||
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
|
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");
|
std::ifstream ifs("opcode.txt");
|
||||||
if(ifs.bad())
|
if(ifs.bad())
|
||||||
@@ -192,6 +196,22 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
|
|||||||
{
|
{
|
||||||
data.append(unit->GetPackGUID());
|
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
|
else
|
||||||
{
|
{
|
||||||
sLog.outDebug("Sending opcode: unknown type '%s'", type.c_str());
|
sLog.outDebug("Sending opcode: unknown type '%s'", type.c_str());
|
||||||
|
|||||||
+10
-10
@@ -6433,21 +6433,21 @@ when attempting to use the PointMovementGenerator
|
|||||||
*/
|
*/
|
||||||
bool ChatHandler::HandleComeToMeCommand(const char *args)
|
bool ChatHandler::HandleComeToMeCommand(const char *args)
|
||||||
{
|
{
|
||||||
Creature* caster = getSelectedCreature();
|
|
||||||
|
|
||||||
if(!caster)
|
|
||||||
{
|
|
||||||
SendSysMessage(LANG_SELECT_CREATURE);
|
|
||||||
SetSentErrorMessage(true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* newFlagStr = strtok((char*)args, " ");
|
char* newFlagStr = strtok((char*)args, " ");
|
||||||
|
|
||||||
if(!newFlagStr)
|
if(!newFlagStr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 newFlags = atoi(newFlagStr);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
caster->SetUnitMovementFlags(newFlags);
|
caster->SetUnitMovementFlags(newFlags);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user