Core/Map: Fix a crash that could happen if a player moved very far away from a creature they were in combat with. Closes #21177.

This commit is contained in:
Treeston authored and Ovahlord committed 2020-07-22 16:52:02 +02:00
1 parent d82abd8256
commit c1237c788b
2 files changed
+6 -3

No files matched your search

+2 -2
View File
@@ -926,12 +926,12 @@ public:
for (auto const& ref : target->GetCombatManager().GetPvPCombatRefs())
{
Unit* unit = ref.second->GetOther(target);
handler->PSendSysMessage("[PvP] %s (DBGUID %u)", unit->GetName().c_str(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0);
handler->PSendSysMessage("[PvP] %s (SpawnID %u)", unit->GetName().c_str(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0);
}
for (auto const& ref : target->GetCombatManager().GetPvECombatRefs())
{
Unit* unit = ref.second->GetOther(target);
handler->PSendSysMessage("[PvE] %s (DBGUID %u)", unit->GetName().c_str(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0);
handler->PSendSysMessage("[PvE] %s (SpawnID %u)", unit->GetName().c_str(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0);
}
return true;
}