From 532293034bbdb8d059b58148efb22057caa9711d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 28 Apr 2022 10:44:04 -0400 Subject: [PATCH] Core/Maps: Always update the grid of player summons even if far away Port From (https://github.com/TrinityCore/TrinityCore/commit/ca498ffab23e9be7a4ffc6ea6adbfa3c01d5e6f6) --- Source/Game/Maps/Map.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index 621aaee0f..f5011f6b2 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -795,6 +795,25 @@ namespace Game.Maps foreach (Unit unit in toVisit) VisitNearbyCellsOf(unit, grid_object_update, world_object_update); } + + { // Update player's summons + List toVisit = new(); + + // Totems + foreach (ObjectGuid summonGuid in player.m_SummonSlot) + { + if (!summonGuid.IsEmpty()) + { + Creature unit = GetCreature(summonGuid); + if (unit != null) + if (unit.GetMapId() == player.GetMapId() && !unit.IsWithinDistInMap(player, GetVisibilityRange(), false)) + toVisit.Add(unit); + } + } + + foreach (Unit unit in toVisit) + VisitNearbyCellsOf(unit, grid_object_update, world_object_update); + } } for (var i = 0; i < m_activeNonPlayers.Count; ++i)