diff --git a/include/hacks/AntiAntiAim.hpp b/include/hacks/AntiAntiAim.hpp index da8a5a9c..2c6bceec 100644 --- a/include/hacks/AntiAntiAim.hpp +++ b/include/hacks/AntiAntiAim.hpp @@ -13,7 +13,6 @@ namespace hacks::shared::anti_anti_aim { - void createMove(); void resolveEnt(int IDX, IClientEntity *entity = nullptr); } // namespace hacks::shared::anti_anti_aim diff --git a/include/hooks/GetFriendPersonaName.hpp b/include/hooks/GetFriendPersonaName.hpp new file mode 100644 index 00000000..76088177 --- /dev/null +++ b/include/hooks/GetFriendPersonaName.hpp @@ -0,0 +1,5 @@ +#include +#include "settings/String.hpp" + +extern settings::String force_name; +extern std::string name_forced; \ No newline at end of file diff --git a/src/hacks/Achievement.cpp b/src/hacks/Achievement.cpp index 058ec30c..a7635b2d 100644 --- a/src/hacks/Achievement.cpp +++ b/src/hacks/Achievement.cpp @@ -9,6 +9,8 @@ #include "Misc.hpp" #include "common.hpp" +namespace hacks::tf2::achievement +{ static settings::Bool safety{ "achievement.safety", "true" }; struct Autoequip_unlock_list @@ -33,9 +35,6 @@ static settings::Int equip_secondary{ "achievement.equip-secondary", "0" }; static settings::Int equip_melee{ "achievement.equip-melee", "0" }; static settings::Int equip_pda2{ "achievement.equip-pda2", "0" }; -namespace hacks::tf2::achievement -{ - void Lock() { if (safety) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 37614b4c..73b2c6b3 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -14,6 +14,8 @@ #include #include "common.hpp" +namespace hacks::shared::aimbot +{ static settings::Bool enable{ "aimbot.enable", "false" }; static settings::Button aimkey{ "aimbot.aimkey.button", "" }; static settings::Int aimkey_mode{ "aimbot.aimkey.mode", "1" }; @@ -82,8 +84,6 @@ int GetSentry() return -1; } -namespace hacks::shared::aimbot -{ settings::Bool ignore_cloak{ "aimbot.target.ignore-cloaked-spies", "1" }; bool shouldBacktrack() { diff --git a/src/hacks/Announcer.cpp b/src/hacks/Announcer.cpp index 4b8b8f43..32ef4742 100644 --- a/src/hacks/Announcer.cpp +++ b/src/hacks/Announcer.cpp @@ -8,10 +8,9 @@ #include #include "common.hpp" -static settings::Bool enable{ "announcer", "false" }; - namespace hacks::shared::announcer { +static settings::Bool enable{ "announcer", "false" }; struct announcer_entry_s { diff --git a/src/hacks/AntiAim.cpp b/src/hacks/AntiAim.cpp index c5be64a3..e540c54d 100644 --- a/src/hacks/AntiAim.cpp +++ b/src/hacks/AntiAim.cpp @@ -11,6 +11,8 @@ #include "common.hpp" +namespace hacks::shared::antiaim +{ static settings::Bool enable{ "antiaim.enable", "0" }; static settings::Float yaw{ "antiaim.yaw.static", "0" }; static settings::Int yaw_mode{ "antiaim.yaw.mode", "0" }; @@ -29,9 +31,6 @@ static settings::Float aaaa_interval_random_low{ "antiaim.aaaa.interval.random-l static settings::Int aaaa_mode{ "antiaim.aaaa.mode", "0" }; static settings::Button aaaa_flip_key{ "antiaim.aaaa.flip-key", "" }; -namespace hacks::shared::antiaim -{ - float cur_yaw = 0.0f; int safe_space = 0; diff --git a/src/hacks/AntiAntiAim.cpp b/src/hacks/AntiAntiAim.cpp index dc5d4acc..8be487ff 100644 --- a/src/hacks/AntiAntiAim.cpp +++ b/src/hacks/AntiAntiAim.cpp @@ -5,9 +5,11 @@ #include #include +namespace hacks::shared::anti_anti_aim +{ static settings::Bool enable{ "anti-anti-aim.enable", "false" }; -void hacks::shared::anti_anti_aim::createMove() +void createMove() { if (!enable) return; @@ -21,7 +23,7 @@ void hacks::shared::anti_anti_aim::createMove() } } -void hacks::shared::anti_anti_aim::resolveEnt(int IDX, IClientEntity *entity) +void resolveEnt(int IDX, IClientEntity *entity) { if (IDX == g_IEngine->GetLocalPlayer()) return; @@ -127,3 +129,4 @@ public: static ResolverListener listener; static InitRoutine init([]() { g_IGameEventManager->AddListener(&listener, false); }); +} // namespace hacks::shared::anti_anti_aim diff --git a/src/hacks/AntiBackstab.cpp b/src/hacks/AntiBackstab.cpp index 8f909caf..b38aa0ba 100644 --- a/src/hacks/AntiBackstab.cpp +++ b/src/hacks/AntiBackstab.cpp @@ -9,18 +9,17 @@ #include "common.hpp" #include "hack.hpp" -static settings::Bool enable{ "antibackstab.enable", "0" }; -static settings::Float distance{ "antibackstab.distance", "200" }; -static settings::Bool silent{ "antibackstab.silent", "1" }; -static settings::Float angle{ "antibackstab.angle", "107.5" }; -static settings::Bool sayno{ "antibackstab.nope", "0" }; - namespace hacks::tf2::autobackstab { extern bool angleCheck(CachedEntity *from, CachedEntity *to, std::optional target_pos, Vector from_angle); } namespace hacks::tf2::antibackstab { +static settings::Bool enable{ "antibackstab.enable", "0" }; +static settings::Float distance{ "antibackstab.distance", "200" }; +static settings::Bool silent{ "antibackstab.silent", "1" }; +static settings::Float angle{ "antibackstab.angle", "107.5" }; +static settings::Bool sayno{ "antibackstab.nope", "0" }; bool noaa = false; void SayNope() diff --git a/src/hacks/AntiCheat.cpp b/src/hacks/AntiCheat.cpp index 7d47aeea..0392e368 100644 --- a/src/hacks/AntiCheat.cpp +++ b/src/hacks/AntiCheat.cpp @@ -13,14 +13,13 @@ #include "PlayerTools.hpp" #include "hack.hpp" +namespace hacks::shared::anticheat +{ static settings::Bool enable{ "find-cheaters.enable", "0" }; static settings::Bool accuse_chat{ "find-cheaters.accuse-in-chat", "0" }; static settings::Bool autorage{ "find-cheaters.auto-rage", "0" }; static settings::Bool skip_local{ "find-cheaters.ignore-local", "1" }; -namespace hacks::shared::anticheat -{ - void Accuse(int eid, const std::string &hack, const std::string &details) { player_info_s info; diff --git a/src/hacks/AutoDeadringer.cpp b/src/hacks/AutoDeadringer.cpp index a362460a..0ebdc9a6 100644 --- a/src/hacks/AutoDeadringer.cpp +++ b/src/hacks/AutoDeadringer.cpp @@ -7,11 +7,10 @@ #include #include "common.hpp" -static settings::Bool enable{ "auto-deadringer.enable", "0" }; -static settings::Int trigger_health{ "auto-deadringer.health", "30" }; - namespace hacks::shared::deadringer { +static settings::Bool enable{ "auto-deadringer.enable", "0" }; +static settings::Int trigger_health{ "auto-deadringer.health", "30" }; bool IsProjectile(CachedEntity *ent) { diff --git a/src/hacks/AutoDetonator.cpp b/src/hacks/AutoDetonator.cpp index 7a073305..b674dd30 100644 --- a/src/hacks/AutoDetonator.cpp +++ b/src/hacks/AutoDetonator.cpp @@ -9,11 +9,10 @@ #include #include "common.hpp" -static settings::Bool enable{ "auto-detonator.enable", "0" }; -static settings::Bool legit{ "auto-detonator.ignore-cloaked", "0" }; - namespace hacks::tf::autodetonator { +static settings::Bool enable{ "auto-detonator.enable", "0" }; +static settings::Bool legit{ "auto-detonator.ignore-cloaked", "0" }; // A storage array for ents std::vector flares; diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp index c41c26aa..c287ce21 100644 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -10,6 +10,8 @@ #include "settings/Bool.hpp" #include "PlayerTools.hpp" +namespace hacks::tf::autoheal +{ static settings::Bool enable{ "autoheal.enable", "false" }; static settings::Bool steamid_only{ "autoheal.steam-only", "false" }; static settings::Bool silent{ "autoheal.silent", "true" }; @@ -41,9 +43,6 @@ static settings::Int auto_vacc_blast_pop_ubers{ "autoheal.vacc.blast.min-charges static settings::Int default_resistance{ "autoheal.vacc.default-resistance", "0" }; static settings::Int steam_var{ "autoheal.steamid", "0" }; -namespace hacks::tf::autoheal -{ - struct patient_data_s { float last_damage{ 0.0f }; diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp index 2c13c85b..fa9e8fda 100644 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -13,15 +13,14 @@ #include "hack.hpp" #include "MiscTemporary.hpp" +namespace hacks::shared::autojoin +{ static settings::Bool autojoin_team{ "autojoin.team", "false" }; static settings::Int autojoin_class{ "autojoin.class", "0" }; static settings::Bool auto_queue{ "autojoin.auto-queue", "false" }; static settings::Bool auto_requeue{ "autojoin.auto-requeue", "false" }; static settings::Bool partybypass{ "hack.party-bypass", "true" }; -namespace hacks::shared::autojoin -{ - /* * Credits to Blackfire for helping me with auto-requeue! */ diff --git a/src/hacks/AutoReflect.cpp b/src/hacks/AutoReflect.cpp index 1b64ca38..e7c359bb 100644 --- a/src/hacks/AutoReflect.cpp +++ b/src/hacks/AutoReflect.cpp @@ -8,6 +8,8 @@ #include "common.hpp" #include +namespace hacks::tf::autoreflect +{ static settings::Bool enable{ "autoreflect.enable", "false" }; static settings::Bool idle_only{ "autoreflect.idle-only", "false" }; static settings::Bool legit{ "autoreflect.legit", "false" }; @@ -22,9 +24,6 @@ static settings::Bool fov_draw{ "autoreflect.draw-fov", "false" }; static settings::Float fovcircle_opacity{ "autoreflect.draw-fov-opacity", "0.7" }; #endif -namespace hacks::tf::autoreflect -{ - bool IsEntStickyBomb(CachedEntity *ent) { // Check if the projectile is a sticky bomb diff --git a/src/hacks/AutoSticky.cpp b/src/hacks/AutoSticky.cpp index 7b6ce039..11564b3b 100644 --- a/src/hacks/AutoSticky.cpp +++ b/src/hacks/AutoSticky.cpp @@ -9,13 +9,12 @@ #include #include +namespace hacks::tf::autosticky +{ static settings::Bool enable{ "autosticky.enable", "false" }; static settings::Bool buildings{ "autosticky.buildings", "true" }; static settings::Bool legit{ "autosticky.legit", "false" }; -namespace hacks::tf::autosticky -{ - // A storage array for ents std::vector bombs; std::vector targets; diff --git a/src/hacks/AutoTaunt.cpp b/src/hacks/AutoTaunt.cpp index 70180ae5..8920df22 100644 --- a/src/hacks/AutoTaunt.cpp +++ b/src/hacks/AutoTaunt.cpp @@ -9,14 +9,13 @@ #include "common.hpp" #include "hack.hpp" +namespace hacks::tf::autotaunt +{ static settings::Bool enable{ "autotaunt.enable", "false" }; static settings::Float chance{ "autotaunt.chance", "100" }; static settings::Float safety{ "autotaunt.safety-distance", "1000" }; static settings::Int switch_weapon{ "autotaunt.auto-weapon", "0" }; -namespace hacks::tf::autotaunt -{ - enum slots { primary = 1, diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 3ecae7b6..7f15bb6f 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -13,14 +13,14 @@ #include "PlayerTools.hpp" #include +namespace hacks::shared::backtrack +{ static settings::Bool draw_bt{ "backtrack.draw", "false" }; static settings::Bool draw_skeleton{ "backtrack.draw-skeleton", "false" }; static settings::Float mindistance{ "backtrack.min-distance", "60" }; static settings::Int slots{ "backtrack.slots", "0" }; -namespace hacks::shared::backtrack -{ settings::Bool enable{ "backtrack.enable", "false" }; settings::Bool backtrack_chams_glow{ "backtrack.chams_glow", "true" }; settings::Int latency{ "backtrack.latency", "0" }; diff --git a/src/hacks/Bunnyhop.cpp b/src/hacks/Bunnyhop.cpp index ab31397c..b1cd479a 100644 --- a/src/hacks/Bunnyhop.cpp +++ b/src/hacks/Bunnyhop.cpp @@ -8,10 +8,9 @@ #include #include "common.hpp" -static settings::Bool enable{ "bunnyhop.enable", "false" }; - namespace hacks::shared::bunnyhop { +static settings::Bool enable{ "bunnyhop.enable", "false" }; // Var for user settings diff --git a/src/hacks/CMakeLists.txt b/src/hacks/CMakeLists.txt index a671cb25..be39de03 100755 --- a/src/hacks/CMakeLists.txt +++ b/src/hacks/CMakeLists.txt @@ -1,9 +1,7 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/AutoJoin.cpp" +set(files "${CMAKE_CURRENT_LIST_DIR}/AutoJoin.cpp" "${CMAKE_CURRENT_LIST_DIR}/CatBot.cpp" "${CMAKE_CURRENT_LIST_DIR}/SeedPrediction.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Spam.cpp") -target_sources(cathook PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/Spam.cpp" "${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp" "${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp" "${CMAKE_CURRENT_LIST_DIR}/MiscAimbot.cpp" @@ -35,9 +33,12 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/PureBypass.cpp" "${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp" "${CMAKE_CURRENT_LIST_DIR}/UberSpam.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Walkbot.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Radar.cpp") - add_subdirectory(ac) + "${CMAKE_CURRENT_LIST_DIR}/Walkbot.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") + +add_subdirectory(ac) if(EnableVisuals) target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/DominateMark.cpp" diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp index 477f3f91..9800fbf5 100644 --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -14,6 +14,8 @@ #include "NavBot.hpp" #include "navparser.hpp" +namespace hacks::shared::catbot +{ static settings::Bool auto_disguise{ "misc.autodisguise", "true" }; static settings::Int abandon_if_bots_gte{ "cat-bot.abandon-if.bots-gte", "0" }; @@ -33,8 +35,6 @@ static settings::Bool autoReport{ "cat-bot.autoreport", "true" }; static settings::Bool mvm_autoupgrade{ "mvm.autoupgrade", "false" }; -namespace hacks::shared::catbot -{ settings::Bool catbotmode{ "cat-bot.enable", "false" }; settings::Bool anti_motd{ "cat-bot.anti-motd", "false" }; diff --git a/src/hacks/CritSay.cpp b/src/hacks/CritSay.cpp index ec38593f..cf8dfa16 100644 --- a/src/hacks/CritSay.cpp +++ b/src/hacks/CritSay.cpp @@ -5,6 +5,9 @@ */ #include #include "common.hpp" + +namespace hacks::shared::critsay +{ static settings::Int critsay_mode{ "critsay.mode", "0" }; static settings::String filename{ "critsay.file", "critsay.txt" }; static settings::Int delay{ "critsay.delay", "100" }; @@ -18,9 +21,6 @@ struct CritsayStorage static std::unordered_map critsay_storage{}; -namespace hacks::shared::critsay -{ - // Thanks HellJustFroze for linking me http://daviseford.com/shittalk/ const std::vector builtin_default = { "Woops, i slipped", "*critical hit* -> %name%", "ok now let's do it again, %name%", "nice" }; diff --git a/src/hacks/DominateMark.cpp b/src/hacks/DominateMark.cpp index 34f5b998..652ee971 100644 --- a/src/hacks/DominateMark.cpp +++ b/src/hacks/DominateMark.cpp @@ -5,6 +5,9 @@ * */ #include "common.hpp" + +namespace hacks::tf2::dominatemark +{ static settings::Bool draw_dominate{ "dominatemark.enable", "false" }; static settings::Float min_size{ "dominatemark.min-size", "15.0f" }; static settings::Float max_size{ "dominatemark.max-size", "40.0f" }; @@ -47,3 +50,4 @@ static InitRoutine init([]() { }, "dominatemark_draw"); }); +} // namespace hacks::tf2::dominatemark diff --git a/src/hacks/DominateSay.cpp b/src/hacks/DominateSay.cpp index e19a39d2..03522ae9 100644 --- a/src/hacks/DominateSay.cpp +++ b/src/hacks/DominateSay.cpp @@ -7,11 +7,11 @@ #include #include "common.hpp" +namespace hacks::shared::dominatesay +{ static settings::Int dominatesay_mode{ "dominatesay.mode", "0" }; static settings::String filename{ "dominatesay.file", "dominatesay.txt" }; -namespace hacks::shared::dominatesay -{ // a much better default dominatesay would be appreciated. const std::vector builtin_default = { "dominating %name%! (%dominum% dominations)", diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 18b19536..a36107b8 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -11,6 +11,8 @@ #include #include "common.hpp" +namespace hacks::shared::esp +{ static settings::Bool enable{ "esp.enable", "false" }; static settings::Int max_dist{ "esp.range", "4096" }; @@ -77,9 +79,6 @@ static settings::Bool online_software{ "esp.online.software", "true" }; static settings::Bool v9mode{ "esp.v952-mode", "false" }; -namespace hacks::shared::esp -{ - // Unknown std::mutex threadsafe_mutex; // Storage array for keeping strings and other data diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 5fabe86a..db91e7a6 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -11,6 +11,8 @@ #include "navparser.hpp" #include "NavBot.hpp" +namespace hacks::shared::followbot +{ static settings::Bool enable{ "follow-bot.enable", "false" }; static settings::Bool roambot{ "follow-bot.roaming", "true" }; static settings::Bool draw_crumb{ "follow-bot.draw-crumbs", "false" }; @@ -26,8 +28,7 @@ static settings::Bool afk{ "follow-bot.switch-afk", "true" }; static settings::Int afktime{ "follow-bot.afk-time", "15000" }; static settings::Bool corneractivate{ "follow-bot.corners", "true" }; static settings::Int steam_var{ "follow-bot.steamid", "0" }; -namespace hacks::shared::followbot -{ + namespace nb = hacks::tf2::NavBot; static Timer navBotInterval{}; diff --git a/src/hacks/KillSay.cpp b/src/hacks/KillSay.cpp index cc6d1001..220b4e28 100644 --- a/src/hacks/KillSay.cpp +++ b/src/hacks/KillSay.cpp @@ -8,6 +8,8 @@ #include #include "common.hpp" +namespace hacks::shared::killsay +{ static settings::Int killsay_mode{ "killsay.mode", "0" }; static settings::String filename{ "killsay.file", "killsays.txt" }; static settings::Int delay{ "killsay.delay", "100" }; @@ -21,9 +23,6 @@ struct KillsayStorage static std::unordered_map killsay_storage{}; -namespace hacks::shared::killsay -{ - // Thanks HellJustFroze for linking me http://daviseford.com/shittalk/ const std::vector builtin_default = { "Don't worry guys, I'm a garbage collector. I'm used to carrying trash.", "%name% is the human equivalent of a participation award.", diff --git a/src/hacks/Killstreak.cpp b/src/hacks/Killstreak.cpp index f13efa42..71950b00 100644 --- a/src/hacks/Killstreak.cpp +++ b/src/hacks/Killstreak.cpp @@ -9,10 +9,9 @@ #include "common.hpp" #include "hooks.hpp" -static settings::Bool enable{ "killstreak.enable", "false" }; - namespace hacks::tf2::killstreak { +static settings::Bool enable{ "killstreak.enable", "false" }; int killstreak{ 0 }; diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index 15d3f492..6f4ae4c9 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -2,10 +2,9 @@ #if ENABLE_VISUALS #include "common.hpp" -static settings::Bool enable{ "lightesp.enable", "false" }; - namespace hacks::shared::lightesp { +static settings::Bool enable{ "lightesp.enable", "false" }; static Vector hitp[32]; static Vector minp[32]; diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index b39dd091..acbc1787 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -20,6 +20,8 @@ #include "hack.hpp" +namespace hacks::shared::misc +{ static settings::Bool render_zoomed{ "visual.render-local-zoomed", "false" }; static settings::Bool anti_afk{ "misc.anti-afk", "false" }; static settings::Bool auto_strafe{ "misc.autostrafe", "false" }; @@ -104,9 +106,6 @@ CatCommand fix_cursor("fix_cursor", "Fix the GUI cursor being visible", []() { g_ISurface->SetCursorAlwaysVisible(false); }); -namespace hacks::shared::misc -{ - // Use to send a autobalance request to the server that doesnt prevent you from // using it again, Allowing infinite use of it. void SendAutoBalanceRequest() @@ -121,7 +120,7 @@ void SendAutoBalanceRequest() // Catcommand for above CatCommand SendAutoBlRqCatCom("request_balance", "Request Infinite Auto-Balance", [](const CCommand &args) { SendAutoBalanceRequest(); }); -static int last_number{ 0 }; +int last_number{ 0 }; static int last_checked_command_number{ 0 }; static IClientEntity *last_checked_weapon{ nullptr }; static bool flash_light_spam_switch{ false }; diff --git a/src/hacks/MiscPlayerInfo.cpp b/src/hacks/MiscPlayerInfo.cpp index f97da587..1fcdcdd1 100644 --- a/src/hacks/MiscPlayerInfo.cpp +++ b/src/hacks/MiscPlayerInfo.cpp @@ -2,6 +2,8 @@ #include "playerlist.hpp" #include +namespace hacks::tf2::miscplayerinfo +{ static settings::Bool draw_kda{ "misc.playerinfo.draw-kda", "false" }; static settings::Bool mafia_city{ "misc.playerinfo.draw-level", "false" }; struct LevelInfo @@ -18,8 +20,7 @@ struct LevelInfo }; // Source: https://www.youtube.com/watch?v=Yke9BhP1uks static std::array mafia_levels{ LevelInfo(0, 9, "Crook"), LevelInfo(50, 50, "Crook"), LevelInfo(10, 10, "Bad Cop"), LevelInfo(0, 10, "Hoody"), LevelInfo(0, 5, "Gangster"), LevelInfo(1, 1, "Poor Man"), LevelInfo(10, 10, "Rich Man"), LevelInfo(10, 34, "Hitman"), LevelInfo(15, 99, "Boss"), LevelInfo(60, 100, "God Father") }; -namespace hacks::tf2::miscplayerinfo -{ + #if ENABLE_VISUALS std::unordered_map> choosen_entry{}; std::unordered_map previous_entry_amount{}; diff --git a/src/hacks/Noisemaker.cpp b/src/hacks/Noisemaker.cpp index 4f2af60f..3eeffea9 100644 --- a/src/hacks/Noisemaker.cpp +++ b/src/hacks/Noisemaker.cpp @@ -8,10 +8,9 @@ #include "common.hpp" #include -static settings::Bool enable{ "noisemaker-spam.enable", "false" }; - namespace hacks::tf2::noisemaker { +static settings::Bool enable{ "noisemaker-spam.enable", "false" }; static void CreateMove() { diff --git a/src/hacks/PureBypass.cpp b/src/hacks/PureBypass.cpp index d5fc5e86..c2f00380 100644 --- a/src/hacks/PureBypass.cpp +++ b/src/hacks/PureBypass.cpp @@ -1,6 +1,8 @@ #include #include "common.hpp" +namespace hacks::shared::purebypass +{ hooks::VMTHook svpurehook{}; static void (*orig_RegisterFileWhilelist)(void *, void *, void *); static void RegisterFileWhitelist(void *_this, void *a, void *b) @@ -13,3 +15,4 @@ static InitRoutine init([] { svpurehook.HookMethod(RegisterFileWhitelist, offsets::RegisterFileWhitelist(), &orig_RegisterFileWhilelist); svpurehook.Apply(); }); +} // namespace hacks::shared::purebypass diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index aeb11dad..8ccf2107 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -10,6 +10,8 @@ #ifndef FEATURE_RADAR_DISABLED #if ENABLE_VISUALS +namespace hacks::tf::radar +{ static settings::Bool radar_enabled{ "radar.enable", "false" }; static settings::Int size{ "radar.size", "300" }; static settings::Float zoom{ "radar.zoom", "10" }; @@ -23,9 +25,6 @@ static settings::Bool show_teammates{ "radar.show.teammates", "true" }; static settings::Bool show_healthpacks{ "radar.show.health", "true" }; static settings::Bool show_ammopacks{ "radar.show.ammo", "true" }; -namespace hacks::tf::radar -{ - Timer invalid{}; std::pair WorldToRadar(int x, int y) diff --git a/src/hacks/SeedPrediction.cpp b/src/hacks/SeedPrediction.cpp index 37563dd9..c9c46acd 100644 --- a/src/hacks/SeedPrediction.cpp +++ b/src/hacks/SeedPrediction.cpp @@ -8,12 +8,14 @@ #include "common.hpp" #include "SeedPrediction.hpp" #include "reclasses.hpp" + +namespace hacks::tf2::seedprediction +{ constexpr float MIN_CLOCKRES = 0.25; constexpr float MAX_CLOCKRES = 8192.5; float clockRes; float seedFraction = 0.0f; -namespace hacks::tf2::seedprediction -{ + static settings::Bool prediction{ "seed-prediction.enable", "false" }; bool predon() { diff --git a/src/hacks/SkinChanger.cpp b/src/hacks/SkinChanger.cpp index 2d4fff95..6ae36cce 100644 --- a/src/hacks/SkinChanger.cpp +++ b/src/hacks/SkinChanger.cpp @@ -13,11 +13,10 @@ #include #include -static settings::Bool enable{ "skinchanger.enable", "false" }; -static settings::Bool debug{ "skinchanger.debug", "false" }; - namespace hacks::tf2::skinchanger { +static settings::Bool enable{ "skinchanger.enable", "false" }; +static settings::Bool debug{ "skinchanger.debug", "false" }; // Because fuck you, that's why. const char *sig_GetAttributeDefinition = "55 89 E5 57 56 53 83 EC 6C C7 45 9C 00 00 00 00"; diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index b788365b..57ccc16e 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -10,6 +10,8 @@ #include "common.hpp" #include "MiscTemporary.hpp" +namespace hacks::shared::spam +{ static settings::Int spam_source{ "spam.source", "0" }; static settings::Bool random_order{ "spam.random", "0" }; static settings::String filename{ "spam.filename", "spam.txt" }; @@ -18,9 +20,6 @@ static settings::Int voicecommand_spam{ "spam.voicecommand", "0" }; static settings::Bool teamname_spam{ "spam.teamname", "0" }; static settings::Bool team_only{ "spam.teamchat", "false" }; -namespace hacks::shared::spam -{ - static int last_index; std::chrono::time_point last_spam_point{}; @@ -397,6 +396,6 @@ static InitRoutine EC([]() { EC::Register(EC::CreateMove, createMove, "spam", EC::average); init(); }); -} // namespace hacks::shared::spam -static CatCommand reload("spam_reload", "Reload spam file", hacks::shared::spam::reloadSpamFile); +static CatCommand reload_cc("spam_reload", "Reload spam file", hacks::shared::spam::reloadSpamFile); +} // namespace hacks::shared::spam diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp index 8c8af56d..7d678eff 100644 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -8,6 +8,8 @@ #include #include "common.hpp" +namespace hacks::tf::spyalert +{ static settings::Bool enable{ "spy-alert.enable", "false" }; static settings::Float distance_warning{ "spy-alert.distance.warning", "500" }; static settings::Float distance_alert{ "spy-alert.distance.alert", "200" }; @@ -16,9 +18,6 @@ static settings::Float sound_alert_interval{ "spy-alert.alert-interval", "3" }; static settings::Bool voicemenu{ "spy-alert.voicemenu", "false" }; static settings::Bool invisible{ "spy-alert.alert-for-invisible", "false" }; -namespace hacks::tf::spyalert -{ - bool warning_triggered = false; bool backstab_triggered = false; float last_say = 0.0f; diff --git a/src/hacks/Thirdperson.cpp b/src/hacks/Thirdperson.cpp index 596cc233..edcfbcd8 100644 --- a/src/hacks/Thirdperson.cpp +++ b/src/hacks/Thirdperson.cpp @@ -8,11 +8,13 @@ #include #include +namespace hacks::tf::thirdperson +{ static settings::Bool enable{ "visual.thirdperson.enable", "false" }; static settings::Bool real_angles{ "visual.thirdperson.real-angles", "false" }; static bool was_enabled{ false }; -void hacks::tf::thirdperson::frameStageNotify() +void frameStageNotify() { if (CE_BAD(LOCAL_E)) return; @@ -36,3 +38,4 @@ void hacks::tf::thirdperson::frameStageNotify() CE_FLOAT(LOCAL_E, netvar.deadflag + 8) = g_Settings.brute.last_angles[LOCAL_E->m_IDX].y; } } +} // namespace hacks::tf::thirdperson diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index 490ef670..0afbc3fc 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -12,6 +12,8 @@ #include #include +namespace hacks::shared::triggerbot +{ static settings::Bool enable{ "trigger.enable", "false" }; static settings::Int hitbox_mode{ "trigger.hitbox-mode", "0" }; static settings::Int accuracy{ "trigger.accuracy", "1" }; @@ -30,9 +32,6 @@ static settings::Bool stickybot{ "trigger.target.stickybombs", "false" }; static settings::Bool teammates{ "trigger.target.teammates", "false" }; static settings::Int max_range{ "trigger.target.max-range", "4096" }; -namespace hacks::shared::triggerbot -{ - // Vars for usersettings float target_time = 0.0f; diff --git a/src/hacks/UberSpam.cpp b/src/hacks/UberSpam.cpp index ce74d1b2..4a5dfaf7 100644 --- a/src/hacks/UberSpam.cpp +++ b/src/hacks/UberSpam.cpp @@ -9,6 +9,8 @@ #include #include +namespace hacks::tf::uberspam +{ static settings::Int source{ "uberspam.source", "0" }; static settings::Bool team_chat{ "uberspam.team-chat", "true" }; static settings::String custom_file{ "uberspam.file", "uberspam.txt" }; @@ -18,9 +20,6 @@ static settings::Bool on_used{ "uberspam.triggers.used", "true" }; static settings::Bool on_ended{ "uberspam.triggers.ended", "true" }; static settings::Int on_build{ "uberspam.triggers.every-n-percent", "25" }; -namespace hacks::tf::uberspam -{ - TextFile custom_lines; static CatCommand custom_file_reload("uberspam_file_reload", "Reload Ubercharge Spam File", []() { custom_lines.Load(*custom_file); }); diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index 03c8d4bd..8a7c871f 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -14,6 +14,8 @@ #include #include +namespace hacks::shared::walkbot +{ static settings::Button recording_key{ "walkbot.recording-key", "" }; static settings::Bool draw_info{ "walkbot.draw.info", "true" }; @@ -29,9 +31,6 @@ static settings::Int reach_distance{ "walkbot.node-reach-distance", "32" }; static settings::Int force_slot{ "walkbot.force-slot", "0" }; static settings::Bool leave_if_empty{ "walkbot.leave-if-empty", "false" }; -namespace hacks::shared::walkbot -{ - using index_t = unsigned; using connection = uint8_t;