fix (cmd): crash fix from console cmd

This commit is contained in:
MDIC
2022-04-30 11:39:14 -04:00
parent 294e39df8a
commit 0ba643ec2e

View File

@@ -181,8 +181,10 @@ public:
ObjectGuid guid = player->GetGUID(); ObjectGuid guid = player->GetGUID();
if (!player) if (!player)
{
player = PlayerIdentifier::FromTarget(handler); player = PlayerIdentifier::FromTarget(handler);
if (!player) }
if (!player || !player->IsConnected())
{ {
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
handler->SetSentErrorMessage(true); handler->SetSentErrorMessage(true);
@@ -210,6 +212,7 @@ public:
handler->PSendSysMessage("Teleport Reports: %u || Climb Reports: %u", teleport_reports, climb_reports); handler->PSendSysMessage("Teleport Reports: %u || Climb Reports: %u", teleport_reports, climb_reports);
handler->PSendSysMessage("Ignore Control Reports: %u || Ignore Z-Axis Reports: %u", ignorecontrol_reports, zaxis_reports); handler->PSendSysMessage("Ignore Control Reports: %u || Ignore Z-Axis Reports: %u", ignorecontrol_reports, zaxis_reports);
return true; return true;
} }
static bool HandleAntiCheatGlobalCommand(ChatHandler* handler) static bool HandleAntiCheatGlobalCommand(ChatHandler* handler)