mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Maps: Always update the grid of player summons even if far away (#25406)
* Core/Maps: Always update the grid of player summons even if far away * Code cleanup * Use a vector instead of unordered_set
This commit is contained in:
@@ -829,6 +829,20 @@ void Map::Update(uint32 t_diff)
|
||||
for (Unit* unit : toVisit)
|
||||
VisitNearbyCellsOf(unit, grid_object_update, world_object_update);
|
||||
}
|
||||
|
||||
{ // Update player's summons
|
||||
std::vector<Unit*> toVisit;
|
||||
|
||||
// Totems
|
||||
for (ObjectGuid const& summonGuid : player->m_SummonSlot)
|
||||
if (summonGuid)
|
||||
if (Creature* unit = GetCreature(summonGuid))
|
||||
if (unit->GetMapId() == player->GetMapId() && !unit->IsWithinDistInMap(player, GetVisibilityRange(), false))
|
||||
toVisit.push_back(unit);
|
||||
|
||||
for (Unit* unit : toVisit)
|
||||
VisitNearbyCellsOf(unit, grid_object_update, world_object_update);
|
||||
}
|
||||
}
|
||||
|
||||
// non-player active objects, increasing iterator in the loop in case of object removal
|
||||
|
||||
Reference in New Issue
Block a user