From 558bf0dcbf52d28c3062e0e42b0ffbe75e98efc8 Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 19 Aug 2018 22:32:22 +0200 Subject: [PATCH] oof --- include/angles.hpp | 3 +-- include/backpacktf.hpp | 1 + include/chatlog.hpp | 1 + include/chatstack.hpp | 1 + include/common.hpp | 3 +-- include/entitycache.hpp | 1 + include/entityhitboxcache.hpp | 1 + include/hacks/ESP.hpp | 3 ++- include/hacks/LightESP.hpp | 2 ++ include/online/Online.hpp | 4 ++++ include/playerlist.hpp | 8 ++++++-- include/visual/CMakeLists.txt | 2 +- include/visual/colors.hpp | 3 ++- src/EventLogging.cpp | 4 +++- src/angles.cpp | 1 - src/backpacktf.cpp | 5 ++--- src/hacks/Aimbot.cpp | 2 ++ src/hacks/AntiAim.cpp | 1 - src/hacks/AntiCheat.cpp | 2 ++ src/hacks/AutoReflect.cpp | 2 ++ src/hacks/Backtrack.cpp | 2 ++ src/hacks/FollowBot.cpp | 2 ++ src/hacks/LightESP.cpp | 5 ++++- src/hacks/Misc.cpp | 2 ++ src/hacks/NavBot.cpp | 2 -- src/hacks/Radar.cpp | 3 ++- src/hacks/Walkbot.cpp | 2 ++ src/hooks/LevelInit.cpp | 7 ++++--- src/playerlist.cpp | 18 ++++++++++++------ src/prediction.cpp | 3 ++- src/visual/CMakeLists.txt | 4 ++-- src/visual/EventLogging.cpp | 4 +++- 32 files changed, 72 insertions(+), 32 deletions(-) diff --git a/include/angles.hpp b/include/angles.hpp index 5d1e2369..305b9828 100644 --- a/include/angles.hpp +++ b/include/angles.hpp @@ -7,9 +7,8 @@ #pragma once -#include #include "common.hpp" - +#include namespace angles { diff --git a/include/backpacktf.hpp b/include/backpacktf.hpp index bd869318..7b230d36 100644 --- a/include/backpacktf.hpp +++ b/include/backpacktf.hpp @@ -6,6 +6,7 @@ */ #pragma once +#include "config.h" namespace backpacktf { diff --git a/include/chatlog.hpp b/include/chatlog.hpp index d39c7e8d..2e207ba8 100755 --- a/include/chatlog.hpp +++ b/include/chatlog.hpp @@ -7,6 +7,7 @@ #pragma once +#include "config.h" #include namespace chatlog diff --git a/include/chatstack.hpp b/include/chatstack.hpp index ba0472ae..a1f48ef2 100644 --- a/include/chatstack.hpp +++ b/include/chatstack.hpp @@ -9,6 +9,7 @@ #define CHATSTACK_INTERVAL 0.8f +#include "config.h" #include #include #include diff --git a/include/common.hpp b/include/common.hpp index e3d92d42..928b1e85 100755 --- a/include/common.hpp +++ b/include/common.hpp @@ -47,9 +47,8 @@ #include "averager.hpp" #include "core/macros.hpp" -#include - #if ENABLE_VISUALS +#include #include #include "visual/fidgetspinner.hpp" #include diff --git a/include/entitycache.hpp b/include/entitycache.hpp index 6ba396b6..1fa3922b 100644 --- a/include/entitycache.hpp +++ b/include/entitycache.hpp @@ -64,6 +64,7 @@ bool IsProjectileACrit(CachedEntity *ent); class CachedEntity { public: + typedef CachedEntity ThisClass; CachedEntity(); ~CachedEntity(); diff --git a/include/entityhitboxcache.hpp b/include/entityhitboxcache.hpp index 0e30cab5..358d0d1f 100644 --- a/include/entityhitboxcache.hpp +++ b/include/entityhitboxcache.hpp @@ -14,6 +14,7 @@ #include #include +class CachedEntity; #define CACHE_MAX_HITBOXES 64 namespace hitbox_cache diff --git a/include/hacks/ESP.hpp b/include/hacks/ESP.hpp index 5f02a774..2f42f43c 100644 --- a/include/hacks/ESP.hpp +++ b/include/hacks/ESP.hpp @@ -8,7 +8,7 @@ #pragma once #include "common.hpp" - +#if ENABLE_VISUALS namespace hacks::shared::esp { @@ -59,3 +59,4 @@ void AddEntityString(CachedEntity *entity, const std::string &string, void SetEntityColor(CachedEntity *entity, const rgba_t &color); void ResetEntityStrings(); } // namespace hacks::shared::esp +#endif \ No newline at end of file diff --git a/include/hacks/LightESP.hpp b/include/hacks/LightESP.hpp index 2e1ec2aa..80f54b32 100644 --- a/include/hacks/LightESP.hpp +++ b/include/hacks/LightESP.hpp @@ -2,7 +2,9 @@ #include namespace hacks::shared::lightesp { +#if ENABLE_VISUALS void run(); void draw(); rgba_t LightESPColor(CachedEntity *ent); +#endif } // namespace hacks::shared::lightesp diff --git a/include/online/Online.hpp b/include/online/Online.hpp index e1db6908..bf1281f0 100644 --- a/include/online/Online.hpp +++ b/include/online/Online.hpp @@ -5,7 +5,9 @@ #pragma once #include +#if ENABLE_VISUALS #include +#endif #include #include @@ -24,7 +26,9 @@ struct user_data bool no_target{ false }; bool is_developer{}; bool has_color{ false }; +#if ENABLE_VISUALS colors::rgba_t color{}; +#endif bool rainbow{ false }; }; diff --git a/include/playerlist.hpp b/include/playerlist.hpp index 96783c81..9568e1d0 100644 --- a/include/playerlist.hpp +++ b/include/playerlist.hpp @@ -24,8 +24,9 @@ enum class k_EState CAT, STATE_LAST = CAT }; - +#if ENABLE_VISUALS extern rgba_t k_Colors[]; +#endif const std::string k_Names[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", "DEVELOPER" }; const char *const k_pszNames[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", @@ -34,7 +35,9 @@ const char *const k_pszNames[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", struct userdata { k_EState state{ k_EState::DEFAULT }; +#if ENABLE_VISUALS rgba_t color{ 0, 0, 0, 0 }; +#endif float inventory_value{ 0 }; unsigned deaths_to{ 0 }; unsigned kills{ 0 }; @@ -50,9 +53,10 @@ constexpr bool IsFriendly(k_EState state) return state == k_EState::DEVELOPER || state == k_EState::FRIEND || state == k_EState::IPC; } - +#if ENABLE_VISUALS rgba_t Color(unsigned steamid); rgba_t Color(CachedEntity *player); +#endif userdata &AccessData(unsigned steamid); userdata &AccessData(CachedEntity *player); bool IsDefault(unsigned steamid); diff --git a/include/visual/CMakeLists.txt b/include/visual/CMakeLists.txt index eeaa9175..0a48c8c6 100755 --- a/include/visual/CMakeLists.txt +++ b/include/visual/CMakeLists.txt @@ -5,8 +5,8 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/drawmgr.hpp" "${CMAKE_CURRENT_LIST_DIR}/EffectChams.hpp" "${CMAKE_CURRENT_LIST_DIR}/EffectGlow.hpp" + "${CMAKE_CURRENT_LIST_DIR}/EventLogging.hpp" "${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.hpp" - "${CMAKE_CURRENT_LIST_DIR}/EventLogging.hpp" "${CMAKE_CURRENT_LIST_DIR}/SDLHooks.hpp") if(EnableGUI) diff --git a/include/visual/colors.hpp b/include/visual/colors.hpp index 8d95028b..e6c0683a 100644 --- a/include/visual/colors.hpp +++ b/include/visual/colors.hpp @@ -10,7 +10,7 @@ #include class CachedEntity; - +#if ENABLE_VISUALS namespace colors { namespace chat @@ -165,3 +165,4 @@ rgba_t EntityF(CachedEntity *ent); } // namespace colors using rgba_t = colors::rgba_t; +#endif \ No newline at end of file diff --git a/src/EventLogging.cpp b/src/EventLogging.cpp index 54043513..a170bb23 100755 --- a/src/EventLogging.cpp +++ b/src/EventLogging.cpp @@ -1,10 +1,11 @@ /* Created on 29.07.18. */ - +#include "config.h" #include #include #include +#if ENABLE_VISUALS #include #include @@ -166,3 +167,4 @@ bool event_logging::isEnabled() { return *enable; } +#endif \ No newline at end of file diff --git a/src/angles.cpp b/src/angles.cpp index 51453216..a97322a3 100644 --- a/src/angles.cpp +++ b/src/angles.cpp @@ -4,7 +4,6 @@ * Created on: Jun 5, 2017 * Author: nullifiedcat */ - #include "angles.hpp" namespace angles diff --git a/src/backpacktf.cpp b/src/backpacktf.cpp index 5b33d6e7..4f1cf2f6 100644 --- a/src/backpacktf.cpp +++ b/src/backpacktf.cpp @@ -4,13 +4,12 @@ * Created on: Jul 23, 2017 * Author: nullifiedcat */ - +#include "config.h" +#include "common.hpp" #include "backpacktf.hpp" #include "json.hpp" #include "https_request.hpp" -#include "common.hpp" - #include #include #include diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index f71e99c1..ae4e89aa 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -10,7 +10,9 @@ #include #include #include +#if ENABLE_VISUALS #include +#endif #include #include #include "common.hpp" diff --git a/src/hacks/AntiAim.cpp b/src/hacks/AntiAim.cpp index 2cadeec9..657240ed 100644 --- a/src/hacks/AntiAim.cpp +++ b/src/hacks/AntiAim.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include diff --git a/src/hacks/AntiCheat.cpp b/src/hacks/AntiCheat.cpp index 3830cb10..10607bb3 100644 --- a/src/hacks/AntiCheat.cpp +++ b/src/hacks/AntiCheat.cpp @@ -35,10 +35,12 @@ void Accuse(int eid, const std::string &hack, const std::string &details) } else { +#if ENABLE_VISUALS PrintChat("\x07%06X%s\x01 (%s) suspected \x07%06X%s\x01: %s", colors::chat::team(ENTITY(eid)->m_iTeam()), info.name, classname(CE_INT(ent, netvar.iClass)), 0xe05938, hack.c_str(), details.c_str()); +#endif } } } diff --git a/src/hacks/AutoReflect.cpp b/src/hacks/AutoReflect.cpp index ff941ee3..66371cd0 100644 --- a/src/hacks/AutoReflect.cpp +++ b/src/hacks/AutoReflect.cpp @@ -7,7 +7,9 @@ #include "common.hpp" #include +#if ENABLE_VISUALS #include +#endif #include static settings::Bool enable{ "autoreflect.enable", "false" }; diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 5d735d0f..3621bc1c 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -9,7 +9,9 @@ #include "hacks/Aimbot.hpp" #include "hacks/Backtrack.hpp" #include +#if ENABLE_VISUALS #include +#endif #include #include diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 7c621b9a..0664ebd3 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -8,7 +8,9 @@ #include "common.hpp" #include +#if ENABLE_VISUALS #include +#endif #include static settings::Bool enable{ "follow-bot.enable", "false" }; diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index d5e8a03f..f1f034a4 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -1,4 +1,6 @@ +#if ENABLE_VISUALS #include +#endif #include #include "hacks/LightESP.hpp" @@ -71,7 +73,7 @@ void draw() } #endif } - +#if ENABLE_VISUALS rgba_t LightESPColor(CachedEntity *ent) { if (!playerlist::IsDefault(ent)) @@ -80,4 +82,5 @@ rgba_t LightESPColor(CachedEntity *ent) } return colors::green; } +#endif } // namespace hacks::shared::lightesp diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index be1c4efc..e507cd2c 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -12,7 +12,9 @@ #include #include #include +#if ENABLE_VISUALS #include +#endif #include #include "core/sharedobj.hpp" diff --git a/src/hacks/NavBot.cpp b/src/hacks/NavBot.cpp index 1b89fc44..78792fdd 100644 --- a/src/hacks/NavBot.cpp +++ b/src/hacks/NavBot.cpp @@ -2,8 +2,6 @@ // Created by bencat07 on 17.08.18. // #include "common.hpp" -#include -#include #include "navparser.hpp" #include "FollowBot.hpp" #include "NavBot.hpp" diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index 9899ffa2..1f546ec4 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -4,8 +4,9 @@ * Created on: Mar 28, 2017 * Author: nullifiedcat */ - +#if ENABLE_VISUALS #include +#endif #include #include "common.hpp" #include "hacks/Radar.hpp" diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index 4810a814..053beba4 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -12,7 +12,9 @@ #include #include #include +#if ENABLE_VISUALS #include +#endif #include static settings::Button recording_key{ "walkbot.recording-key", "" }; diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp index 39b7178f..978b7a01 100644 --- a/src/hooks/LevelInit.cpp +++ b/src/hooks/LevelInit.cpp @@ -5,7 +5,9 @@ #include #include +#if ENABLE_VISUALS #include +#endif #include "HookedMethods.hpp" #include "MiscTemporary.hpp" #include "navparser.hpp" @@ -78,14 +80,13 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) logging::Info("Loaded Skybox: %s", succ ? "true" : "false"); ConVar *holiday = g_ICvar->FindVar("tf_forced_holiday"); - for (int i = 0; i < 32; i++) - g_Settings.brute.brutenum[i] = 0; if (halloween_mode) holiday->SetValue(2); else if (holiday->m_nValue == 2) holiday->SetValue(0); #endif - + for (int i = 0; i < 32; i++) + g_Settings.brute.brutenum[i] = 0; g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); #if !LAGBOT_MODE hacks::shared::aimbot::Reset(); diff --git a/src/playerlist.cpp b/src/playerlist.cpp index 00211ed8..928822ea 100644 --- a/src/playerlist.cpp +++ b/src/playerlist.cpp @@ -18,14 +18,17 @@ namespace playerlist std::unordered_map data{}; const userdata null_data{}; - +#if ENABLE_VISUALS rgba_t k_Colors[] = { colors::empty, colors::FromRGBA8(99, 226, 161, 255), colors::FromRGBA8(226, 204, 99, 255), colors::FromRGBA8(232, 134, 6, 255), colors::empty }; - +#endif bool ShouldSave(const userdata &data) { +#if ENABLE_VISUALS return data.color || (data.state != k_EState::DEFAULT); +#endif + return (data.state != k_EState::DEFAULT); } void Save() @@ -114,7 +117,7 @@ void Load() logging::Info("Reading unsuccessful: %s", e.what()); } } - +#if ENABLE_VISUALS rgba_t Color(unsigned steamid) { if (AccessData(steamid).state == k_EState::DEVELOPER) @@ -137,7 +140,7 @@ rgba_t Color(CachedEntity *player) return Color(player->player_info.friendsID); return colors::empty; } - +#endif userdata &AccessData(unsigned steamid) { return data[steamid]; @@ -154,7 +157,10 @@ userdata &AccessData(CachedEntity *player) bool IsDefault(unsigned steamid) { const userdata &data = AccessData(steamid); +#if ENABLE_VISUALS return data.state == k_EState::DEFAULT && !data.color.a; +#endif + return data.state == k_EState ::DEFAULT; } bool IsDefault(CachedEntity *entity) @@ -184,7 +190,7 @@ CatCommand pl_set_state( AccessData(steamid).state = state; logging::Info("Set %d to %d", steamid, state); }); - +#if ENABLE_VISUALS CatCommand pl_set_color("pl_set_color", "pl_set_color uniqueid r g b", [](const CCommand &args) { if (args.ArgC() < 5) @@ -201,7 +207,7 @@ CatCommand pl_set_color("pl_set_color", "pl_set_color uniqueid r g b", AccessData(steamid).color = color; logging::Info("Changed %d's color", steamid); }); - +#endif CatCommand pl_info("pl_info", "pl_info uniqueid", [](const CCommand &args) { if (args.ArgC() < 2) { diff --git a/src/prediction.cpp b/src/prediction.cpp index 100ead10..8d9f1cd4 100644 --- a/src/prediction.cpp +++ b/src/prediction.cpp @@ -4,8 +4,9 @@ * Created on: Dec 5, 2016 * Author: nullifiedcat */ - +#if ENABLE_VISUALS #include +#endif #include #include "common.hpp" diff --git a/src/visual/CMakeLists.txt b/src/visual/CMakeLists.txt index cc633bc2..3795c4e0 100755 --- a/src/visual/CMakeLists.txt +++ b/src/visual/CMakeLists.txt @@ -5,10 +5,10 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/drawmgr.cpp" "${CMAKE_CURRENT_LIST_DIR}/EffectChams.cpp" "${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp" + "${CMAKE_CURRENT_LIST_DIR}/EventLogging.cpp" "${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.cpp" - "${CMAKE_CURRENT_LIST_DIR}/EventLogging.cpp" "${CMAKE_CURRENT_LIST_DIR}/SDLHooks.cpp") if(EnableGUI) add_subdirectory(menu) -endif() \ No newline at end of file +endif() diff --git a/src/visual/EventLogging.cpp b/src/visual/EventLogging.cpp index 54043513..a170bb23 100755 --- a/src/visual/EventLogging.cpp +++ b/src/visual/EventLogging.cpp @@ -1,10 +1,11 @@ /* Created on 29.07.18. */ - +#include "config.h" #include #include #include +#if ENABLE_VISUALS #include #include @@ -166,3 +167,4 @@ bool event_logging::isEnabled() { return *enable; } +#endif \ No newline at end of file