Scripts/Commands: Improve ".debug objectcount"

Port From (https://github.com/TrinityCore/TrinityCore/commit/4e3d23188e02d2c79f09460590d0f43a5f81a982)
This commit is contained in:
hondacrx
2022-06-09 20:50:52 -04:00
parent 2dcbe3e840
commit 452dd95e39
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -733,7 +733,7 @@ namespace Game.Chat
{
void HandleDebugObjectCountMap(Map map)
{
handler.SendSysMessage($"Map Id: {map.GetId()} Name: '{map.GetMapName()}' Instance Id: {map.GetInstanceId()} Creatures: {map.GetObjectsStore().OfType<Creature>().Count()} GameObjects: {map.GetObjectsStore().OfType<GameObject>().Count()}");
handler.SendSysMessage($"Map Id: {map.GetId()} Name: '{map.GetMapName()}' Instance Id: {map.GetInstanceId()} Creatures: {map.GetObjectsStore().OfType<Creature>().Count()} GameObjects: {map.GetObjectsStore().OfType<GameObject>().Count()} SetActive Objects: {map.GetActiveNonPlayersCount()}");
Dictionary<uint, uint> creatureIds = new();
foreach (var p in map.GetObjectsStore())
+5
View File
@@ -3865,6 +3865,11 @@ namespace Game.Maps
return m_activePlayers;
}
public int GetActiveNonPlayersCount()
{
return m_activeNonPlayers.Count;
}
public Dictionary<ObjectGuid, WorldObject> GetObjectsStore() { return _objectsStore; }
public MultiMap<ulong, Creature> GetCreatureBySpawnIdStore() { return _creatureBySpawnIdStore; }