Core/Maps: Continue updating creatures that own auras applied to players. Closes #22110.

This commit is contained in:
Treeston authored and Aokromes committed 2018-07-24 11:18:07 +02:00
1 parent 66b7e68296
commit c58246d981
1 file changed
+12
+12
View File
@@ -839,6 +839,18 @@ void Map::Update(uint32 t_diff)
for (Creature* c : updateList)
VisitNearbyCellsOf(c, 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