aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2021-01-23 15:54:25 +0100
committerShauren <shauren.trinity@gmail.com>2022-03-06 01:23:14 +0100
commit4e3d23188e02d2c79f09460590d0f43a5f81a982 (patch)
treefded73b1c2a04a8bbfb9274a96c5954ecd65c698
parent42c52538cd005c4816820738e771413140917c20 (diff)
Scripts/Commands: Improve ".debug objectcount"
Include the number of SetActive objects in ".debug objectcount" command (cherry picked from commit d0231c5a8fdea9704be442cbd8840079caf47a6d)
-rw-r--r--src/server/game/Maps/Map.h5
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 24e21fa72a7..47848abe696 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -619,6 +619,11 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
_updateObjects.erase(obj);
}
+ size_t GetActiveNonPlayersCount() const
+ {
+ return m_activeNonPlayers.size();
+ }
+
virtual std::string GetDebugInfo() const;
private:
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 9039b1e3fbb..5fc4e46895e 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1688,10 +1688,11 @@ public:
static void HandleDebugObjectCountMap(ChatHandler* handler, Map* map)
{
- handler->PSendSysMessage("Map Id: %u Name: '%s' Instance Id: %u Creatures: " UI64FMTD " GameObjects: " UI64FMTD,
+ handler->PSendSysMessage("Map Id: %u Name: '%s' Instance Id: %u Creatures: " UI64FMTD " GameObjects: " UI64FMTD " SetActive Objects: " UI64FMTD,
map->GetId(), map->GetMapName(), map->GetInstanceId(),
uint64(map->GetObjectsStore().Size<Creature>()),
- uint64(map->GetObjectsStore().Size<GameObject>()));
+ uint64(map->GetObjectsStore().Size<GameObject>()),
+ uint64(map->GetActiveNonPlayersCount()));
CreatureCountWorker worker;
TypeContainerVisitor<CreatureCountWorker, MapStoredObjectTypesContainer> visitor(worker);