Scripts/Command: Fixed phases output in .pinfo command

Closes #19144
This commit is contained in:
joschiwald
2017-02-17 21:54:49 +01:00
parent 06c1db0a0e
commit 80c36f3d9c
5 changed files with 34 additions and 10 deletions
+9 -2
View File
@@ -1047,13 +1047,20 @@ public:
if (!*args)
return false;
uint32 phase = (uint32)atoi((char*)args);
uint32 phaseId = uint32(atoul(args));
if (!sPhaseStore.LookupEntry(phaseId))
{
handler->SendSysMessage(LANG_PHASE_NOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
Unit* target = handler->getSelectedUnit();
if (!target)
target = handler->GetSession()->GetPlayer();
target->SetInPhase(phase, true, !target->IsInPhase(phase));
target->SetInPhase(phaseId, true, !target->IsInPhase(phaseId));
if (target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->SendUpdatePhasing();