From 2514e5d75ee845b9fcabc8b455b34fc0a9f57c75 Mon Sep 17 00:00:00 2001 From: julianacat Date: Wed, 2 Aug 2017 20:15:58 -0500 Subject: [PATCH] Few changes with debug command --- simple-ipc | 2 +- src/hacks/Spam.cpp | 2 +- src/helpers.cpp | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/simple-ipc b/simple-ipc index dd569c63..e532876f 160000 --- a/simple-ipc +++ b/simple-ipc @@ -1 +1 @@ -Subproject commit dd569c63b2ca85e8d9d395a586d54464bb0e1916 +Subproject commit e532876ffd707a48389d54ff904dcc40a84f2839 diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index 4d72160e..d059047a 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -25,7 +25,6 @@ CatVar teamname_spam(CV_SWITCH, "spam_teamname", "0", "Teamname Spam", "Spam cha std::chrono::time_point last_spam_point {}; -bool teamname_swap = false; int current_index { 0 }; TextFile file {}; @@ -185,6 +184,7 @@ void CreateMove() { IF_GAME (IsTF2()) { // Spam changes the tournament name in casual and compeditive gamemodes if (teamname_spam) { + static bool teamname_swap = false; if (teamname_swap) { teamname_swap = false; g_IEngine->ServerCmd("tournament_teamname Cat"); diff --git a/src/helpers.cpp b/src/helpers.cpp index 6d427130..18525921 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -752,6 +752,24 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) { return false; } +CatCommand print_classnames("debug_print_classnames", "Lists classnames currently available in console", []() { + + CachedEntity* ent; + + // Go through all the entities + for (int i = 0; i < HIGHEST_ENTITY; i++) { + + // Get an entity + ent = ENTITY(i); + // Check for null/dormant + if (CE_BAD(ent)) continue; + + // Print in console, the class name of the ent + logging::Info(format(RAW_ENT(ent)->GetClientClass()->m_pNetworkName).c_str()); + } + +}); + void PrintChat(const char* fmt, ...) { CHudBaseChat* chat = (CHudBaseChat*)g_CHUD->FindElement("CHudChat"); if (chat) {