Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster
Port From (https://github.com/TrinityCore/TrinityCore/commit/8f3904f8fd4e7536d1e7ba8e701f4774519fd867)
This commit is contained in:
@@ -579,28 +579,39 @@ namespace Game.Chat.Commands
|
||||
string stringOverdue = Global.ObjectMgr.GetCypherString(CypherStrings.ListRespawnsOverdue, locale);
|
||||
|
||||
uint zoneId = player.GetZoneId();
|
||||
|
||||
string zoneName = GetZoneName(zoneId, locale);
|
||||
for (SpawnObjectType type = 0; type < SpawnObjectType.Max; type++)
|
||||
{
|
||||
if (range != 0)
|
||||
handler.SendSysMessage(CypherStrings.ListRespawnsRange, type, range);
|
||||
else
|
||||
handler.SendSysMessage(CypherStrings.ListRespawnsZone, type, GetZoneName(zoneId, locale), zoneId);
|
||||
handler.SendSysMessage(CypherStrings.ListRespawnsZone, type, zoneName, zoneId);
|
||||
handler.SendSysMessage(CypherStrings.ListRespawnsListheader);
|
||||
List<RespawnInfo> respawns = new();
|
||||
map.GetRespawnInfo(respawns, (SpawnObjectTypeMask)(1 << (int)type), range != 0 ? 0 : zoneId);
|
||||
map.GetRespawnInfo(respawns, (SpawnObjectTypeMask)(1 << (int)type));
|
||||
foreach (RespawnInfo ri in respawns)
|
||||
{
|
||||
SpawnData data = Global.ObjectMgr.GetSpawnData(ri.type, ri.spawnId);
|
||||
if (data == null)
|
||||
continue;
|
||||
if (range != 0 && !player.IsInDist(data.spawnPoint, range))
|
||||
continue;
|
||||
|
||||
uint respawnZoneId = map.GetZoneId(PhasingHandler.EmptyPhaseShift, data.spawnPoint);
|
||||
if (range != 0)
|
||||
{
|
||||
if (!player.IsInDist(data.spawnPoint, range))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (zoneId != respawnZoneId)
|
||||
continue;
|
||||
}
|
||||
|
||||
uint gridY = ri.gridId / MapConst.MaxGrids;
|
||||
uint gridX = ri.gridId % MapConst.MaxGrids;
|
||||
|
||||
string respawnTime = ri.respawnTime > GameTime.GetGameTime() ? Time.secsToTimeString((ulong)(ri.respawnTime - GameTime.GetGameTime()), true) : stringOverdue;
|
||||
handler.SendSysMessage($"{ri.spawnId} | {ri.entry} | [{gridX:2},{gridY:2}] | {GetZoneName(ri.zoneId, locale)} ({ri.zoneId}) | {respawnTime}{(map.IsSpawnGroupActive(data.spawnGroupData.groupId) ? "" : " (inactive)")}");
|
||||
handler.SendSysMessage($"{ri.spawnId} | {ri.entry} | [{gridX:2},{gridY:2}] | {GetZoneName(respawnZoneId, locale)} ({respawnZoneId}) | {respawnTime}{(map.IsSpawnGroupActive(data.spawnGroupData.groupId) ? "" : " (inactive)")}");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1953,7 +1953,7 @@ namespace Game.Chat
|
||||
|
||||
// Now handle any that had despawned, but had respawn time logged.
|
||||
List<RespawnInfo> data = new();
|
||||
player.GetMap().GetRespawnInfo(data, SpawnObjectTypeMask.All, 0);
|
||||
player.GetMap().GetRespawnInfo(data, SpawnObjectTypeMask.All);
|
||||
if (!data.Empty())
|
||||
{
|
||||
uint gridId = GridDefines.ComputeGridCoord(player.GetPositionX(), player.GetPositionY()).GetId();
|
||||
|
||||
Reference in New Issue
Block a user