aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Maps/Map.cpp5
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 5dac23ddb07..f8d122f99f5 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -792,10 +792,13 @@ void Map::Update(uint32 t_diff)
// Handle updates for creatures in combat with player and are more than 60 yards away
if (player->IsInCombat())
{
+ std::vector<Unit*> toVisit;
for (auto const& pair : player->GetCombatManager().GetPvECombatRefs())
if (Creature* unit = pair.second->GetOther(player)->ToCreature())
if (unit->GetMapId() == player->GetMapId() && !unit->IsWithinDistInMap(player, GetVisibilityRange(), false))
- VisitNearbyCellsOf(unit, grid_object_update, world_object_update);
+ toVisit.push_back(unit);
+ for (Unit* unit : toVisit)
+ VisitNearbyCellsOf(unit, grid_object_update, world_object_update);
}
}
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 427a5f923ed..8ec08191185 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -920,12 +920,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;
}