mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Maps: Continue updating creatures that own auras applied to players. Closes #22110.
This commit is contained in:
@@ -803,6 +803,18 @@ void Map::Update(uint32 t_diff)
|
||||
for (Unit* unit : toVisit)
|
||||
VisitNearbyCellsOf(unit, grid_object_update, world_object_update);
|
||||
}
|
||||
|
||||
{ // Update any creatures that own auras the player has applications of
|
||||
std::unordered_set<Unit*> toVisit;
|
||||
for (std::pair<uint32, AuraApplication*> pair : player->GetAppliedAuras())
|
||||
{
|
||||
if (Unit* caster = pair.second->GetBase()->GetCaster())
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
toVisit.insert(caster);
|
||||
}
|
||||
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