diff --git a/include/config.h.in b/include/config.h.in index 48ab0479..ae03b13e 100755 --- a/include/config.h.in +++ b/include/config.h.in @@ -15,4 +15,5 @@ #define ENABLE_TEXTMODE_STDIN @EnableTextmodeStdin@ #define ENABLE_NULL_GRAPHICS @EnableNullGraphics@ #define TEXTMODE @Textmode@ -#define ENABLE_PROFILER @EnableProfiler@ \ No newline at end of file +#define ENABLE_PROFILER @EnableProfiler@ +#define ENABLE_ONLINE @EnableOnlineFeatures@ diff --git a/include/online/Online.hpp b/include/online/Online.hpp index bf1281f0..c6d60008 100644 --- a/include/online/Online.hpp +++ b/include/online/Online.hpp @@ -3,7 +3,8 @@ */ #pragma once - +#include "config.h" +#if ENABLE_ONLINE #include #if ENABLE_VISUALS #include @@ -39,3 +40,4 @@ void update(); user_data *getUserData(unsigned steamId); } // namespace online +#endif diff --git a/src/PlayerTools.cpp b/src/PlayerTools.cpp index ccbf994c..d09c1b1e 100644 --- a/src/PlayerTools.cpp +++ b/src/PlayerTools.cpp @@ -49,7 +49,7 @@ IgnoreReason shouldTargetSteamId(unsigned id) auto &pl = playerlist::AccessData(id); if (playerlist::IsFriendly(pl.state)) return IgnoreReason::LOCAL_PLAYER_LIST; - +#if ENABLE_ONLINE auto *co = online::getUserData(id); if (co) { @@ -67,7 +67,7 @@ IgnoreReason shouldTargetSteamId(unsigned id) if (co->is_developer) return IgnoreReason::DEVELOPER; } - +#endif return IgnoreReason::DO_NOT_IGNORE; } IgnoreReason shouldTarget(CachedEntity *entity) @@ -93,11 +93,11 @@ bool shouldAlwaysRenderEspSteamId(unsigned id) auto &pl = playerlist::AccessData(id); if (pl.state != playerlist::k_EState::DEFAULT) return true; - +#if ENABLE_ONLINE auto *co = online::getUserData(id); if (co) return true; - +#endif return false; } bool shouldAlwaysRenderEsp(CachedEntity *entity) @@ -158,4 +158,4 @@ void onKilledBy(CachedEntity *entity) { onKilledBy(entity->player_info.friendsID); } -} // namespace player_tools \ No newline at end of file +} // namespace player_tools diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index f1f034a4..c05b16bd 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -1,8 +1,8 @@ +#include "hacks/LightESP.hpp" #if ENABLE_VISUALS #include #endif #include -#include "hacks/LightESP.hpp" static settings::Bool enable{ "lightesp.enable", "false" }; diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index e507cd2c..99b82b0b 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -5,6 +5,7 @@ * Author: nullifiedcat */ +#include "common.hpp" #include #include #include @@ -20,7 +21,6 @@ #include "core/sharedobj.hpp" #include "hack.hpp" -#include "common.hpp" static settings::Bool render_zoomed{ "visuals.render-local-zoomed", "false" }; static settings::Bool anti_afk{ "misc.anti-afk", "false" }; diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index 1f546ec4..5fb9168d 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -4,11 +4,11 @@ * Created on: Mar 28, 2017 * Author: nullifiedcat */ +#include "common.hpp" #if ENABLE_VISUALS #include #endif #include -#include "common.hpp" #include "hacks/Radar.hpp" #ifndef FEATURE_RADAR_DISABLED diff --git a/src/hooks/Paint.cpp b/src/hooks/Paint.cpp index eb4ef9c8..9883ce24 100644 --- a/src/hooks/Paint.cpp +++ b/src/hooks/Paint.cpp @@ -29,7 +29,9 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode) #endif hacks::shared::catbot::update(); hitrate::Update(); +#if ENABLE_ONLINE online::update(); +#endif #if ENABLE_IPC static Timer nametimer{}; if (nametimer.test_and_set(1000 * 10)) diff --git a/src/online/Online.cpp b/src/online/Online.cpp index de490928..a9080929 100644 --- a/src/online/Online.cpp +++ b/src/online/Online.cpp @@ -1,7 +1,8 @@ /* Created on 23.06.18. */ - +#include "config.h" +#if ENABLE_ONLINE #include #include @@ -12,6 +13,7 @@ #undef null + #include #include #include @@ -332,4 +334,5 @@ user_data *getUserData(unsigned steamId) // SteamID does not belong to online user return nullptr; } -} // namespace online \ No newline at end of file +} // namespace online +#endif diff --git a/src/prediction.cpp b/src/prediction.cpp index 8d9f1cd4..06ef1818 100644 --- a/src/prediction.cpp +++ b/src/prediction.cpp @@ -4,11 +4,11 @@ * Created on: Dec 5, 2016 * Author: nullifiedcat */ +#include "common.hpp" #if ENABLE_VISUALS #include #endif #include -#include "common.hpp" static settings::Bool debug_enginepred{ "debug.engine-pred-others", "false" }; static settings::Bool debug_pp_extrapolate{ "debug.pp-extrapolate", "false" };