internal void LoadHelper <T>(SortedSet <ulong> guid_set, CellCoord cell, ref uint count, Map map, uint phaseId = 0, ObjectGuid?phaseOwner = null) where T : WorldObject, new() { foreach (var guid in guid_set) { // Don't spawn at all if there's a respawn timer if (!map.ShouldBeSpawnedOnGridLoad <T>(guid)) { continue; } T obj = new(); if (!obj.LoadFromDB(guid, map, false, phaseOwner.HasValue /*allowDuplicate*/)) { obj.Dispose(); continue; } if (phaseOwner.HasValue) { PhasingHandler.InitDbPersonalOwnership(obj.GetPhaseShift(), phaseOwner.Value); map.GetMultiPersonalPhaseTracker().RegisterTrackedObject(phaseId, phaseOwner.Value, obj); } AddObjectHelper(cell, ref count, map, obj); } }