From 210bfe31e45fcac0b5f87a0ce51fbd3e4203acb4 Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 24 Jun 2018 10:49:23 +0200 Subject: [PATCH 1/5] Create CONTRIBUTING.md --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..5b715a51 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# NullWorks code style (Work in progress) + +## C/C++ + +### General + +- Code must be formatted with `clang-format`, the `.clang-format` settings file is provided within this repo. +- `using namespace` is strictly forbidden. +- [Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation) is forbidden. + +### File names + +`PascalCase`. + +### Header files + +Header files must have extension of `.hpp` and be guarded with `#pragma once` in the beginning. + +### Variable names + +- Variable names must be `lower_snake_case`, member variable names **must not** be prefixed by `m_` or any other prefixes. +- Constants must be in `UPPER_SNAKE_CASE` and use `constexpr`, not `#define`. For example: `constexpr int MAX = 100;`. + +### Namespace names + +Namespace names follow the same rules as *Variable names*. + +### Function names + +Function/method names must be in `lowerCamelCase`. + +### Class names + +- Class names must be in `PascalCase`. +- Struct names must be in `lower_snake_case`. From e95dd9db803bdb90c467d40c441c25caf683063c Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 24 Jun 2018 11:19:49 +0200 Subject: [PATCH 2/5] Update for gcc-7 --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ab85e47..6c9615fc 100755 --- a/README.md +++ b/README.md @@ -66,11 +66,11 @@ Make sure to put the required files in ../requirements/lib*, and cathook in ../c ### Outdated (but might be helpful): -You can use gcc-7 for compiling cathook if you add `-e CC=gcc-7 CXX=g++-7` to make command line +You need to use gcc-7 for compiling cathook if you add `-e CC=gcc-7 CXX=g++-7` to make command line -Ubuntu gcc6 installation: (check if you have gcc-6 installed already by typing `gcc-6 -v` +Ubuntu gcc7 installation: (check if you have gcc-6 installed already by typing `gcc-6 -v` ```bash -sudo apt update && sudo apt install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot g++-6-multilib gcc-6 g++-6 -y +sudo apt update && sudo apt install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot g++-7-multilib gcc-7 g++-7 -y ``` Ubuntu other dependencies installation: @@ -79,6 +79,7 @@ Ubuntu other dependencies installation: sudo apt update && sudo apt install git libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libfreetype6-dev:i386 -y ``` +### Even more Outdated (but miht still be helpful): Arch gcc6 & dependencies installation: ```bash @@ -111,7 +112,7 @@ git clone --recursive https://github.com/nullworks/cathook && cd cathook && bash **Errors while installing?** -`/usr/include/c++/5/string:38:28: fatal error: bits/c++config.h: No such file or directory` +`/usr/include/c++/7/string:38:28: fatal error: bits/c++config.h: No such file or directory` You don't have gcc-7-multilib installed correctly. Anything related to `glez` or `xoverlay` From d09d72fb8349ad604a91ccd0cda3ada1dc7678e0 Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 24 Jun 2018 11:20:26 +0200 Subject: [PATCH 3/5] Add gcc-7 to install all --- install-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-all b/install-all index aba9ac68..34f2f6e2 100755 --- a/install-all +++ b/install-all @@ -8,7 +8,7 @@ rm ../install-all # remove install file sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt update -sudo apt install build-essential git gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-6-multilib gcc-6 g++-6 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y +sudo apt install build-essential git gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-7-multilib gcc-7 g++-7 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y # # Update cathook From ab3a0591eacf1852e333a0d1b79439b0b5fc5839 Mon Sep 17 00:00:00 2001 From: LightCat Date: Sun, 24 Jun 2018 11:26:20 +0200 Subject: [PATCH 4/5] fix gay --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c9615fc..51cc91c1 100755 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Ubuntu other dependencies installation: sudo apt update && sudo apt install git libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libfreetype6-dev:i386 -y ``` -### Even more Outdated (but miht still be helpful): +### Even more Outdated (but might still be helpful): Arch gcc6 & dependencies installation: ```bash From d99a869e387aa9db6841949f92c93a62786c17db Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 24 Jun 2018 12:31:34 +0200 Subject: [PATCH 5/5] Namespace updates --- include/MiscTemporary.hpp | 1 - include/core/cvwrapper.hpp | 8 +--- include/hacks/AutoHeal.hpp | 8 +--- include/hacks/AutoJoin.hpp | 8 +--- include/hacks/AutoReflect.hpp | 8 +--- include/hacks/AutoSticky.hpp | 8 +--- include/hacks/AutoTaunt.hpp | 8 +--- include/hacks/Backtrack.hpp | 8 +--- include/hacks/Bunnyhop.hpp | 8 +--- include/hacks/CatBot.hpp | 8 +--- include/hacks/ESP.hpp | 8 +--- include/hacks/FollowBot.hpp | 8 +--- include/hacks/HealArrows.hpp | 8 +--- include/hacks/KillSay.hpp | 8 +--- include/hacks/Killstreak.hpp | 8 +--- include/hacks/LagExploit.hpp | 8 +--- include/hacks/LightESP.hpp | 8 +--- include/hacks/Misc.hpp | 8 +--- include/hacks/Noisemaker.hpp | 8 +--- include/hacks/Radar.hpp | 8 +--- include/hacks/SkinChanger.hpp | 8 +--- include/hacks/Spam.hpp | 8 +--- include/hacks/SpyAlert.hpp | 8 +--- include/hacks/Trigger.hpp | 8 +--- include/hacks/UberSpam.hpp | 8 +--- include/hacks/Walkbot.hpp | 8 +--- include/hacks/ac/aimbot.hpp | 5 +- include/hacks/ac/antiaim.hpp | 5 +- include/hacks/ac/bhop.hpp | 5 +- include/visual/menu/ncc/Item.hpp | 5 +- include/visual/menu/ncc/ItemSublist.hpp | 5 +- include/visual/menu/ncc/ItemTitle.hpp | 5 +- include/visual/menu/ncc/ItemVariable.hpp | 5 +- include/visual/menu/ncc/List.hpp | 5 +- include/visual/menu/ncc/Menu.hpp | 5 +- include/visual/menu/ncc/PlayerList.hpp | 5 +- include/visual/menu/ncc/PlayerListEntry.hpp | 5 +- include/visual/menu/ncc/Root.hpp | 5 +- include/visual/menu/ncc/Tooltip.hpp | 5 +- src/MiscTemporary.cpp | 2 - src/core/cvwrapper.cpp | 8 +--- src/entityhitboxcache.cpp | 3 +- src/hacks/Aimbot.cpp | 10 +--- src/hacks/Announcer.cpp | 9 +--- src/hacks/AntiAim.cpp | 8 +--- src/hacks/AntiBackstab.cpp | 8 +--- src/hacks/AntiCheat.cpp | 8 +--- src/hacks/AntiDisguise.cpp | 8 +--- src/hacks/AutoBackstab.cpp | 8 +--- src/hacks/AutoDeadringer.cpp | 8 +--- src/hacks/AutoDetonator.cpp | 8 +--- src/hacks/AutoHeal.cpp | 8 +--- src/hacks/AutoJoin.cpp | 8 +--- src/hacks/AutoReflect.cpp | 8 +--- src/hacks/AutoSticky.cpp | 8 +--- src/hacks/AutoTaunt.cpp | 8 +--- src/hacks/Backtrack.cpp | 8 +--- src/hacks/Bunnyhop.cpp | 8 +--- src/hacks/CatBot.cpp | 8 +--- src/hacks/ESP.cpp | 12 ++--- src/hacks/FollowBot.cpp | 8 +--- src/hacks/HealArrows.cpp | 8 +--- src/hacks/KillSay.cpp | 8 +--- src/hacks/Killstreak.cpp | 8 +--- src/hacks/LagExploit.cpp | 52 +++++++++------------ src/hacks/LightESP.cpp | 8 +--- src/hacks/Misc.cpp | 10 +--- src/hacks/Noisemaker.cpp | 8 +--- src/hacks/Radar.cpp | 8 +--- src/hacks/SkinChanger.cpp | 8 +--- src/hacks/Spam.cpp | 8 +--- src/hacks/SpyAlert.cpp | 8 +--- src/hacks/Trigger.cpp | 8 +--- src/hacks/UberSpam.cpp | 8 +--- src/hacks/Walkbot.cpp | 8 +--- src/hacks/ac/aimbot.cpp | 5 +- src/hacks/ac/antiaim.cpp | 7 ++- src/hacks/ac/bhop.cpp | 5 +- src/hooks/CreateMove.cpp | 29 ++++++++++-- 79 files changed, 133 insertions(+), 509 deletions(-) diff --git a/include/MiscTemporary.hpp b/include/MiscTemporary.hpp index 87c892ad..48b2a1ef 100644 --- a/include/MiscTemporary.hpp +++ b/include/MiscTemporary.hpp @@ -20,7 +20,6 @@ extern CatVar joinclass; extern CatVar jointeam; extern CatVar fakelag_amount; extern CatVar serverlag_amount; -extern CatVar serverlag_string; extern CatVar servercrash; extern CatVar debug_projectiles; extern CatVar semiauto; diff --git a/include/core/cvwrapper.hpp b/include/core/cvwrapper.hpp index abf12d3b..b8171f82 100644 --- a/include/core/cvwrapper.hpp +++ b/include/core/cvwrapper.hpp @@ -41,16 +41,10 @@ public: int max_value; int size; }; -namespace hacks -{ -namespace tf2 -{ -namespace global +namespace hacks::tf2::global { void runcfg(); } -} -} // TODO reverse, no idea how catcommands are handled class CatCommand { diff --git a/include/hacks/AutoHeal.hpp b/include/hacks/AutoHeal.hpp index 4a6831ee..ed6c0222 100755 --- a/include/hacks/AutoHeal.hpp +++ b/include/hacks/AutoHeal.hpp @@ -9,11 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace autoheal +namespace hacks::tf::autoheal { // TODO extern CatVar target_only; void CreateMove(); @@ -35,5 +31,3 @@ int BestTarget(); int HealingPriority(int idx); bool CanHeal(int idx); } -} -} diff --git a/include/hacks/AutoJoin.hpp b/include/hacks/AutoJoin.hpp index 0d94d738..4476e6df 100755 --- a/include/hacks/AutoJoin.hpp +++ b/include/hacks/AutoJoin.hpp @@ -7,11 +7,7 @@ #pragma once #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace autojoin +namespace hacks::shared::autojoin { extern CatVar auto_queue; @@ -20,5 +16,3 @@ extern Timer queuetime; void Update(); void UpdateSearch(); } -} -} diff --git a/include/hacks/AutoReflect.hpp b/include/hacks/AutoReflect.hpp index faf593d0..5ed509fd 100755 --- a/include/hacks/AutoReflect.hpp +++ b/include/hacks/AutoReflect.hpp @@ -9,16 +9,10 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace autoreflect +namespace hacks::tf::autoreflect { void Draw(); void CreateMove(); bool ShouldReflect(CachedEntity *ent); bool IsEntStickyBomb(CachedEntity *ent); } -} -} diff --git a/include/hacks/AutoSticky.hpp b/include/hacks/AutoSticky.hpp index 2f89cba6..c65c4e31 100755 --- a/include/hacks/AutoSticky.hpp +++ b/include/hacks/AutoSticky.hpp @@ -9,14 +9,8 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace autosticky +namespace hacks::tf::autosticky { bool ShouldDetonate(CachedEntity *bomb); void CreateMove(); } -} -} diff --git a/include/hacks/AutoTaunt.hpp b/include/hacks/AutoTaunt.hpp index 487bd601..1f0a4610 100755 --- a/include/hacks/AutoTaunt.hpp +++ b/include/hacks/AutoTaunt.hpp @@ -10,13 +10,7 @@ class CatVar; class InitRoutine; -namespace hacks -{ -namespace tf -{ -namespace autotaunt +namespace hacks::tf::autotaunt { extern InitRoutine init; } -} -} diff --git a/include/hacks/Backtrack.hpp b/include/hacks/Backtrack.hpp index e5529137..0534c7f0 100644 --- a/include/hacks/Backtrack.hpp +++ b/include/hacks/Backtrack.hpp @@ -9,11 +9,7 @@ #include "common.hpp" #include -namespace hacks -{ -namespace shared -{ -namespace backtrack +namespace hacks::shared::backtrack { struct BacktrackData { @@ -61,5 +57,3 @@ extern CatVar enable; extern BacktrackData headPositions[32][66]; extern BestTickData sorted_ticks[66]; } -} -} diff --git a/include/hacks/Bunnyhop.hpp b/include/hacks/Bunnyhop.hpp index 37410723..e05eeb49 100755 --- a/include/hacks/Bunnyhop.hpp +++ b/include/hacks/Bunnyhop.hpp @@ -9,13 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace bunnyhop +namespace hacks::shared::bunnyhop { void CreateMove(); } -} -} diff --git a/include/hacks/CatBot.hpp b/include/hacks/CatBot.hpp index 27eb5565..787dd13e 100755 --- a/include/hacks/CatBot.hpp +++ b/include/hacks/CatBot.hpp @@ -9,11 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace catbot +namespace hacks::shared::catbot { bool is_a_catbot(unsigned steamID); @@ -26,5 +22,3 @@ void level_init(); void update_ipc_data(ipc::user_data_s &data); #endif } -} -} diff --git a/include/hacks/ESP.hpp b/include/hacks/ESP.hpp index db9826cb..dfab1d5d 100755 --- a/include/hacks/ESP.hpp +++ b/include/hacks/ESP.hpp @@ -9,11 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace esp +namespace hacks::shared::esp { // Strings @@ -63,5 +59,3 @@ void AddEntityString(CachedEntity *entity, const std::string &string, void SetEntityColor(CachedEntity *entity, const rgba_t &color); void ResetEntityStrings(); } -} -} diff --git a/include/hacks/FollowBot.hpp b/include/hacks/FollowBot.hpp index baa660ca..dc66fe85 100644 --- a/include/hacks/FollowBot.hpp +++ b/include/hacks/FollowBot.hpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace followbot +namespace hacks::shared::followbot { // Followed entity, externed for highlight color @@ -24,5 +20,3 @@ extern unsigned steamid; void DrawTick(); void WorldTick(); } -} -} diff --git a/include/hacks/HealArrows.hpp b/include/hacks/HealArrows.hpp index 1e9cb3bb..acccef59 100755 --- a/include/hacks/HealArrows.hpp +++ b/include/hacks/HealArrows.hpp @@ -7,16 +7,10 @@ #pragma once -namespace hacks -{ -namespace tf2 -{ -namespace healarrow +namespace hacks::tf2::healarrow { void CreateMove(); void Draw(); void Init(); } -} -} diff --git a/include/hacks/KillSay.hpp b/include/hacks/KillSay.hpp index 820992b0..7f75ac9c 100755 --- a/include/hacks/KillSay.hpp +++ b/include/hacks/KillSay.hpp @@ -16,11 +16,7 @@ class KillSayEventListener : public IGameEventListener2 virtual void FireGameEvent(IGameEvent *event); }; -namespace hacks -{ -namespace shared -{ -namespace killsay +namespace hacks::shared::killsay { void Init(); @@ -32,5 +28,3 @@ extern const std::vector builtin_default; extern const std::vector builtin_nonecore_offensive; extern const std::vector builtin_nonecore_mlg; } -} -} diff --git a/include/hacks/Killstreak.hpp b/include/hacks/Killstreak.hpp index 62fc883d..df309f4c 100755 --- a/include/hacks/Killstreak.hpp +++ b/include/hacks/Killstreak.hpp @@ -9,11 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace killstreak +namespace hacks::tf2::killstreak { int current_streak(); @@ -22,5 +18,3 @@ void shutdown(); void fire_event(IGameEvent *event); void apply_killstreaks(); } -} -} diff --git a/include/hacks/LagExploit.hpp b/include/hacks/LagExploit.hpp index e58cf38c..64715fbd 100755 --- a/include/hacks/LagExploit.hpp +++ b/include/hacks/LagExploit.hpp @@ -11,11 +11,7 @@ // Idea from UC (instant bomb defuse thread) -namespace hacks -{ -namespace shared -{ -namespace lagexploit +namespace hacks::shared::lagexploit { extern const model_t *pointarr[5]; extern bool bcalled; @@ -24,5 +20,3 @@ void Draw(); void AddExploitTicks(int ticks); bool ExploitActive(); } -} -} \ No newline at end of file diff --git a/include/hacks/LightESP.hpp b/include/hacks/LightESP.hpp index d25fd436..6a01b6ed 100644 --- a/include/hacks/LightESP.hpp +++ b/include/hacks/LightESP.hpp @@ -1,14 +1,8 @@ #include "common.hpp" #include -namespace hacks -{ -namespace shared -{ -namespace lightesp +namespace hacks::shared::lightesp { void run(); void draw(); rgba_t LightESPColor(CachedEntity *ent); } -} -} diff --git a/include/hacks/Misc.hpp b/include/hacks/Misc.hpp index 99939615..36f158a6 100755 --- a/include/hacks/Misc.hpp +++ b/include/hacks/Misc.hpp @@ -10,11 +10,7 @@ #include "common.hpp" #include "config.h" -namespace hacks -{ -namespace shared -{ -namespace misc +namespace hacks::shared::misc { void CreateMove(); @@ -26,8 +22,6 @@ extern int last_number; extern float last_bucket; } -} -} /*class Misc : public IHack { public: diff --git a/include/hacks/Noisemaker.hpp b/include/hacks/Noisemaker.hpp index cb8c053e..dde8d269 100755 --- a/include/hacks/Noisemaker.hpp +++ b/include/hacks/Noisemaker.hpp @@ -9,13 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace noisemaker +namespace hacks::tf2::noisemaker { void CreateMove(); } -} -} diff --git a/include/hacks/Radar.hpp b/include/hacks/Radar.hpp index 70e7e8a4..85e8da07 100755 --- a/include/hacks/Radar.hpp +++ b/include/hacks/Radar.hpp @@ -10,15 +10,9 @@ #include "visual/atlas.hpp" #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace radar +namespace hacks::tf::radar { std::pair WorldToRadar(int x, int y); void Draw(); } -} -} #endif diff --git a/include/hacks/SkinChanger.hpp b/include/hacks/SkinChanger.hpp index dadb1542..07c629ef 100755 --- a/include/hacks/SkinChanger.hpp +++ b/include/hacks/SkinChanger.hpp @@ -9,11 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace skinchanger +namespace hacks::tf2::skinchanger { class CAttributeList; @@ -142,5 +138,3 @@ void InvalidateCookie(); void FrameStageNotify(int stage); void DrawText(); } -} -} diff --git a/include/hacks/Spam.hpp b/include/hacks/Spam.hpp index 4a1d002d..c4e88c05 100755 --- a/include/hacks/Spam.hpp +++ b/include/hacks/Spam.hpp @@ -11,11 +11,7 @@ class CatCommand; -namespace hacks -{ -namespace shared -{ -namespace spam +namespace hacks::shared::spam { extern const std::vector builtin_default; @@ -31,5 +27,3 @@ void Init(); void CreateMove(); void Reload(); } -} -} diff --git a/include/hacks/SpyAlert.hpp b/include/hacks/SpyAlert.hpp index eeb291cd..8967bd54 100755 --- a/include/hacks/SpyAlert.hpp +++ b/include/hacks/SpyAlert.hpp @@ -9,13 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace spyalert +namespace hacks::tf::spyalert { void Draw(); } -} -} diff --git a/include/hacks/Trigger.hpp b/include/hacks/Trigger.hpp index 9a9ae85a..5aa54f96 100755 --- a/include/hacks/Trigger.hpp +++ b/include/hacks/Trigger.hpp @@ -11,11 +11,7 @@ class CatVar; -namespace hacks -{ -namespace shared -{ -namespace triggerbot +namespace hacks::shared::triggerbot { void CreateMove(); @@ -28,5 +24,3 @@ float EffectiveTargetingRange(); void Draw(); bool CheckLineBox(Vector B1, Vector B2, Vector L1, Vector L2, Vector &Hit); } -} -} diff --git a/include/hacks/UberSpam.hpp b/include/hacks/UberSpam.hpp index cdb58558..e5e41428 100755 --- a/include/hacks/UberSpam.hpp +++ b/include/hacks/UberSpam.hpp @@ -9,11 +9,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace uberspam +namespace hacks::tf::uberspam { void CreateMove(); @@ -23,5 +19,3 @@ void CreateMove(); extern const std::vector builtin_cathook; extern const std::vector builtin_nonecore; } -} -} diff --git a/include/hacks/Walkbot.hpp b/include/hacks/Walkbot.hpp index 291a4d7b..c114035c 100755 --- a/include/hacks/Walkbot.hpp +++ b/include/hacks/Walkbot.hpp @@ -9,11 +9,7 @@ #include "config.h" -namespace hacks -{ -namespace shared -{ -namespace walkbot +namespace hacks::shared::walkbot { void Initialize(); @@ -23,5 +19,3 @@ void Draw(); void Move(); void OnLevelInit(); } -} -} diff --git a/include/hacks/ac/aimbot.hpp b/include/hacks/ac/aimbot.hpp index f5299971..6846feda 100755 --- a/include/hacks/ac/aimbot.hpp +++ b/include/hacks/ac/aimbot.hpp @@ -12,9 +12,7 @@ class KeyValues; class CachedEntity; -namespace ac -{ -namespace aimbot +namespace ac::aimbot { struct ac_data @@ -32,4 +30,3 @@ void Init(); void Update(CachedEntity *player); void Event(KeyValues *event); } -} diff --git a/include/hacks/ac/antiaim.hpp b/include/hacks/ac/antiaim.hpp index 12af292f..241f3b5e 100755 --- a/include/hacks/ac/antiaim.hpp +++ b/include/hacks/ac/antiaim.hpp @@ -10,9 +10,7 @@ class KeyValues; class CachedEntity; -namespace ac -{ -namespace antiaim +namespace ac::antiaim { extern int amount[32]; @@ -23,4 +21,3 @@ void Init(); void Update(CachedEntity *player); void Event(KeyValues *event); } -} diff --git a/include/hacks/ac/bhop.hpp b/include/hacks/ac/bhop.hpp index 71e9b27c..00bf44a5 100755 --- a/include/hacks/ac/bhop.hpp +++ b/include/hacks/ac/bhop.hpp @@ -10,9 +10,7 @@ class KeyValues; class CachedEntity; -namespace ac -{ -namespace bhop +namespace ac::bhop { struct ac_data @@ -30,4 +28,3 @@ void Init(); void Update(CachedEntity *player); void Event(KeyValues *event); } -} diff --git a/include/visual/menu/ncc/Item.hpp b/include/visual/menu/ncc/Item.hpp index 047d251c..0fd37af8 100755 --- a/include/visual/menu/ncc/Item.hpp +++ b/include/visual/menu/ncc/Item.hpp @@ -9,9 +9,7 @@ #include "../CBaseWidget.h" -namespace menu -{ -namespace ncc +namespace menu::ncc { class Item : public CBaseWidget @@ -29,4 +27,3 @@ public: virtual void HandleCustomEvent(KeyValues *event) override; }; } -} diff --git a/include/visual/menu/ncc/ItemSublist.hpp b/include/visual/menu/ncc/ItemSublist.hpp index 3c949f1b..8dc13866 100755 --- a/include/visual/menu/ncc/ItemSublist.hpp +++ b/include/visual/menu/ncc/ItemSublist.hpp @@ -12,9 +12,7 @@ class CatVar; -namespace menu -{ -namespace ncc +namespace menu::ncc { class List; // ???? @@ -37,4 +35,3 @@ public: const std::string title; }; } -} diff --git a/include/visual/menu/ncc/ItemTitle.hpp b/include/visual/menu/ncc/ItemTitle.hpp index 3373effa..50f8dde0 100755 --- a/include/visual/menu/ncc/ItemTitle.hpp +++ b/include/visual/menu/ncc/ItemTitle.hpp @@ -9,9 +9,7 @@ #include "menu/ncc/Item.hpp" -namespace menu -{ -namespace ncc +namespace menu::ncc { class ItemTitle : public Item @@ -25,4 +23,3 @@ public: const std::string title; }; } -} diff --git a/include/visual/menu/ncc/ItemVariable.hpp b/include/visual/menu/ncc/ItemVariable.hpp index d0b56cdf..31848030 100755 --- a/include/visual/menu/ncc/ItemVariable.hpp +++ b/include/visual/menu/ncc/ItemVariable.hpp @@ -11,9 +11,7 @@ class CatVar; -namespace menu -{ -namespace ncc +namespace menu::ncc { class ItemVariable : public Item @@ -36,4 +34,3 @@ public: bool capturing{ false }; }; } -} diff --git a/include/visual/menu/ncc/List.hpp b/include/visual/menu/ncc/List.hpp index 4d0f3df4..336d6208 100755 --- a/include/visual/menu/ncc/List.hpp +++ b/include/visual/menu/ncc/List.hpp @@ -12,9 +12,7 @@ class Item; -namespace menu -{ -namespace ncc +namespace menu::ncc { class List : public CBaseContainer @@ -64,4 +62,3 @@ public: } }; } -} diff --git a/include/visual/menu/ncc/Menu.hpp b/include/visual/menu/ncc/Menu.hpp index 2d0ab0c6..cb2af04c 100755 --- a/include/visual/menu/ncc/Menu.hpp +++ b/include/visual/menu/ncc/Menu.hpp @@ -23,9 +23,7 @@ #include "menu/ncc/Root.hpp" #include "menu/ncc/Tooltip.hpp" -namespace menu -{ -namespace ncc +namespace menu::ncc { class List; @@ -48,4 +46,3 @@ void ShowTooltip(const std::string &text); void Init(); List &MainList(); } -} diff --git a/include/visual/menu/ncc/PlayerList.hpp b/include/visual/menu/ncc/PlayerList.hpp index 84497aa1..9f1110c9 100755 --- a/include/visual/menu/ncc/PlayerList.hpp +++ b/include/visual/menu/ncc/PlayerList.hpp @@ -9,9 +9,7 @@ #include "../CBaseContainer.h" #include "menu/ncc/Menu.hpp" -namespace menu -{ -namespace ncc +namespace menu::ncc { constexpr int size_table[] = { 32, 32, 80, 160, 80, 80, 32, 32, 32 }; @@ -30,4 +28,3 @@ public: inline virtual void SortByZIndex() override{}; }; } -} diff --git a/include/visual/menu/ncc/PlayerListEntry.hpp b/include/visual/menu/ncc/PlayerListEntry.hpp index 230a1be3..b19a69b9 100755 --- a/include/visual/menu/ncc/PlayerListEntry.hpp +++ b/include/visual/menu/ncc/PlayerListEntry.hpp @@ -9,9 +9,7 @@ #include "menu/ncc/Menu.hpp" -namespace menu -{ -namespace ncc +namespace menu::ncc { class PlayerListEntry : public CBaseContainer @@ -76,4 +74,3 @@ public: }; } } -} diff --git a/include/visual/menu/ncc/Root.hpp b/include/visual/menu/ncc/Root.hpp index ba699fb0..5a933205 100755 --- a/include/visual/menu/ncc/Root.hpp +++ b/include/visual/menu/ncc/Root.hpp @@ -9,9 +9,7 @@ #include "../CBaseWindow.h" -namespace menu -{ -namespace ncc +namespace menu::ncc { class Root : public CBaseWindow @@ -25,4 +23,3 @@ public: inline virtual void MoveChildren() override{}; }; } -} diff --git a/include/visual/menu/ncc/Tooltip.hpp b/include/visual/menu/ncc/Tooltip.hpp index 5d77fbd4..b69f15ee 100755 --- a/include/visual/menu/ncc/Tooltip.hpp +++ b/include/visual/menu/ncc/Tooltip.hpp @@ -11,9 +11,7 @@ #include "common.hpp" -namespace menu -{ -namespace ncc +namespace menu::ncc { class Tooltip : public CTextLabel @@ -29,4 +27,3 @@ public: } }; } -} \ No newline at end of file diff --git a/src/MiscTemporary.cpp b/src/MiscTemporary.cpp index e2d73757..dca4ed33 100644 --- a/src/MiscTemporary.cpp +++ b/src/MiscTemporary.cpp @@ -22,8 +22,6 @@ CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag"); CatVar serverlag_amount( CV_INT, "serverlag", "0", "serverlag", "Lag the server by spamming this many voicecommands per tick"); -CatVar serverlag_string(CV_STRING, "serverlag_string", "voicemenu 0 0", - "serverlag string", "String to spam with serverlag"); CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", "Crash servers by spamming signon net messages"); CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); diff --git a/src/core/cvwrapper.cpp b/src/core/cvwrapper.cpp index 2ce6be13..d6276852 100644 --- a/src/core/cvwrapper.cpp +++ b/src/core/cvwrapper.cpp @@ -24,11 +24,7 @@ enum torun }; int torun = -1; std::string Args[3]; -namespace hacks -{ -namespace tf2 -{ -namespace global +namespace hacks::tf2::global { void runcfg() { @@ -125,8 +121,6 @@ void runcfg() torun = -1; } } -} -} static CatCommand cfg_rebase("cfg_setbase", "Rebase config", []() { torun = rebase; }); diff --git a/src/entityhitboxcache.cpp b/src/entityhitboxcache.cpp index 4137a77d..f9e09cc6 100644 --- a/src/entityhitboxcache.cpp +++ b/src/entityhitboxcache.cpp @@ -47,7 +47,8 @@ void EntityHitboxCache::Update() { InvalidateCache(); if (CE_BAD(parent_ref)) - return; + if (GetHitbox(0)) + return; } void EntityHitboxCache::Init() diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index e39f98e5..80d8d60d 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -12,11 +12,7 @@ #include #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace aimbot +namespace hacks::shared::aimbot { // User settings are stored and used by these vars @@ -1357,6 +1353,4 @@ void DrawText() } } #endif -} // namespace aimbot -} // namespace shared -} // namespace hacks +} // namespace hacks::shared::aimbot diff --git a/src/hacks/Announcer.cpp b/src/hacks/Announcer.cpp index 87ae2152..09d9bd4a 100755 --- a/src/hacks/Announcer.cpp +++ b/src/hacks/Announcer.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace announcer +namespace hacks::shared::announcer { static CatVar enabled(CV_SWITCH, "announcer", "0", "Enable announcer"); @@ -181,5 +177,4 @@ void shutdown() g_IEventManager2->RemoveListener(&listener()); } } -} -} + diff --git a/src/hacks/AntiAim.cpp b/src/hacks/AntiAim.cpp index 70771068..6f17899b 100644 --- a/src/hacks/AntiAim.cpp +++ b/src/hacks/AntiAim.cpp @@ -8,11 +8,7 @@ #include #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace antiaim +namespace hacks::shared::antiaim { CatVar communicate(CV_SWITCH, "identify", "0", "identify", @@ -630,5 +626,3 @@ void ProcessUserCmd(CUserCmd *cmd) g_pLocalPlayer->bUseSilentAngles = true; } } -} -} diff --git a/src/hacks/AntiBackstab.cpp b/src/hacks/AntiBackstab.cpp index 424be331..e700877b 100644 --- a/src/hacks/AntiBackstab.cpp +++ b/src/hacks/AntiBackstab.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include "hack.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace antibackstab +namespace hacks::tf2::antibackstab { bool noaa = false; static CatVar enabled(CV_SWITCH, "antibackstab", "0", "Enable", @@ -119,5 +115,3 @@ void CreateMove() } } } -} -} diff --git a/src/hacks/AntiCheat.cpp b/src/hacks/AntiCheat.cpp index 01d19768..cec897c7 100644 --- a/src/hacks/AntiCheat.cpp +++ b/src/hacks/AntiCheat.cpp @@ -11,11 +11,7 @@ #include "common.hpp" #include "hack.hpp" -namespace hacks -{ -namespace shared -{ -namespace anticheat +namespace hacks::shared::anticheat { static CatVar enabled(CV_SWITCH, "ac_enabled", "0", "Enable AC"); static CatVar accuse_chat(CV_SWITCH, "ac_chat", "0", "Accuse in chat"); @@ -122,5 +118,3 @@ void Init() g_IGameEventManager->AddListener(&listener, false); } } -} -} diff --git a/src/hacks/AntiDisguise.cpp b/src/hacks/AntiDisguise.cpp index 7e743571..4a0289ed 100644 --- a/src/hacks/AntiDisguise.cpp +++ b/src/hacks/AntiDisguise.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace antidisguise +namespace hacks::tf2::antidisguise { static CatVar enabled(CV_SWITCH, "antidisguise", "0", "Remove spy disguise", @@ -54,5 +50,3 @@ void Draw() } } } -} -} diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index d55b6926..3fd55f16 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include "hacks/Backtrack.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace autobackstab +namespace hacks::tf2::autobackstab { // pPaste, thanks to F1ssi0N @@ -70,5 +66,3 @@ void CreateMove() } } } -} -} diff --git a/src/hacks/AutoDeadringer.cpp b/src/hacks/AutoDeadringer.cpp index 9c229aa5..22afeeb8 100644 --- a/src/hacks/AutoDeadringer.cpp +++ b/src/hacks/AutoDeadringer.cpp @@ -5,11 +5,7 @@ * Author: bencat07 */ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace deadringer +namespace hacks::shared::deadringer { static CatVar enabled(CV_SWITCH, "deadringer_auto", "0", "Auto deadringer", @@ -75,5 +71,3 @@ void CreateMove() } } } -} -} diff --git a/src/hacks/AutoDetonator.cpp b/src/hacks/AutoDetonator.cpp index 5ca87539..cedf1381 100644 --- a/src/hacks/AutoDetonator.cpp +++ b/src/hacks/AutoDetonator.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace autodetonator +namespace hacks::tf::autodetonator { // Vars for user settings @@ -140,5 +136,3 @@ void CreateMove() return; } } -} -} diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp index ec665eed..54f04446 100644 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -9,11 +9,7 @@ #include #include -namespace hacks -{ -namespace tf -{ -namespace autoheal +namespace hacks::tf::autoheal { static CatVar enabled(CV_SWITCH, "autoheal_enabled", "0", "AutoHeal", @@ -602,5 +598,3 @@ bool CanHeal(int idx) return true; } } -} -} diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp index 7150c1f9..b596c288 100644 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include "hack.hpp" -namespace hacks -{ -namespace shared -{ -namespace autojoin +namespace hacks::shared::autojoin { /* @@ -137,5 +133,3 @@ void Update() #endif } } -} -} diff --git a/src/hacks/AutoReflect.cpp b/src/hacks/AutoReflect.cpp index 522fefda..1b3d4d62 100644 --- a/src/hacks/AutoReflect.cpp +++ b/src/hacks/AutoReflect.cpp @@ -9,11 +9,7 @@ #include #include -namespace hacks -{ -namespace tf -{ -namespace autoreflect +namespace hacks::tf::autoreflect { // Vars for user settings @@ -246,5 +242,3 @@ void Draw() #endif } } -} -} \ No newline at end of file diff --git a/src/hacks/AutoSticky.cpp b/src/hacks/AutoSticky.cpp index 65360dc1..10db1ca5 100644 --- a/src/hacks/AutoSticky.cpp +++ b/src/hacks/AutoSticky.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include -namespace hacks -{ -namespace tf -{ -namespace autosticky +namespace hacks::tf::autosticky { // Vars for user settings @@ -190,5 +186,3 @@ void CreateMove() return; } } -} -} diff --git a/src/hacks/AutoTaunt.cpp b/src/hacks/AutoTaunt.cpp index f81fbd56..9c88c23a 100644 --- a/src/hacks/AutoTaunt.cpp +++ b/src/hacks/AutoTaunt.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include "hack.hpp" -namespace hacks -{ -namespace tf -{ -namespace autotaunt +namespace hacks::tf::autotaunt { static CatVar enabled( @@ -48,5 +44,3 @@ InitRoutine init([]() { g_IEventManager2->AddListener(&listener, "player_death", false); }); } -} -} diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index d1389516..5d2965da 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -10,11 +10,7 @@ #include #include -namespace hacks -{ -namespace shared -{ -namespace backtrack +namespace hacks::shared::backtrack { CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack", "For legit play only as of right now."); @@ -279,5 +275,3 @@ bool shouldBacktrack() return false; } } -} -} diff --git a/src/hacks/Bunnyhop.cpp b/src/hacks/Bunnyhop.cpp index c9a69a07..4dbbe015 100644 --- a/src/hacks/Bunnyhop.cpp +++ b/src/hacks/Bunnyhop.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace bunnyhop +namespace hacks::shared::bunnyhop { // Var for user settings @@ -64,5 +60,3 @@ void CreateMove() return; } } -} -} diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp index 041e6bf3..77accb49 100644 --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include "hack.hpp" -namespace hacks -{ -namespace shared -{ -namespace catbot +namespace hacks::shared::catbot { static CatVar enabled(CV_SWITCH, "cbu", "0", "CatBot Utils"); @@ -326,5 +322,3 @@ void level_init() level_init_timer.update(); } } -} -} diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 1f886bf3..51bc4483 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -9,11 +9,7 @@ #include #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace esp +namespace hacks::shared::esp { // Main Switch @@ -351,7 +347,9 @@ void CreateMove() CachedEntity *ent = ENTITY(i); ProcessEntity(ent); - + // Update Bones + if (i <= 32) + ent->hitboxes.GetHitbox(0); // Dont know what this check is for if (data[i].string_count) { @@ -1628,5 +1626,3 @@ void SetEntityColor(CachedEntity *entity, const rgba_t &color) data[entity->m_IDX].color = color; } } -} -} diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 424101cb..10287413 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -11,11 +11,7 @@ #include #include -namespace hacks -{ -namespace shared -{ -namespace followbot +namespace hacks::shared::followbot { CatVar followbot(CV_SWITCH, "fb", "0", "Followbot Switch", @@ -334,5 +330,3 @@ static CatCommand }); #endif } -} -} diff --git a/src/hacks/HealArrows.cpp b/src/hacks/HealArrows.cpp index e6a79835..2131fd29 100755 --- a/src/hacks/HealArrows.cpp +++ b/src/hacks/HealArrows.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace healarrow +namespace hacks::tf2::healarrow { static CatVar healarrow_charge(CV_FLOAT, "healarrow_charge", "0.25", @@ -148,5 +144,3 @@ void Draw() #endif } } -} -} diff --git a/src/hacks/KillSay.cpp b/src/hacks/KillSay.cpp index 0fdda034..28054272 100644 --- a/src/hacks/KillSay.cpp +++ b/src/hacks/KillSay.cpp @@ -8,11 +8,7 @@ #include #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace killsay +namespace hacks::shared::killsay { static CatEnum killsay_enum({ "NONE", "CUSTOM", "DEFAULT", "NCC - OFFENSIVE", @@ -161,8 +157,6 @@ const std::vector builtin_nonecore_mlg = { "U GOT QUICKSCOPED M8", "2 FAST 4 U, SCRUB", "U GOT REKT, M8" }; } -} -} void KillSayEventListener::FireGameEvent(IGameEvent *event) { diff --git a/src/hacks/Killstreak.cpp b/src/hacks/Killstreak.cpp index c94d0fb8..97cd12e3 100644 --- a/src/hacks/Killstreak.cpp +++ b/src/hacks/Killstreak.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include "hooks.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace killstreak +namespace hacks::tf2::killstreak { static CatVar enabled(CV_SWITCH, "killstreak", "0", @@ -139,5 +135,3 @@ void init() { } } -} -} diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index f0c03767..a9d2da47 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -9,11 +9,7 @@ #include #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace lagexploit +namespace hacks::shared::lagexploit { static CatVar toggle(CV_SWITCH, "se_toggle", "0", "toggle", @@ -94,6 +90,28 @@ float servertime, nextattack, nextattack2; static int lastwep = 0; void CreateMove() { + if (!bcalled) + for (int i = 1; i < HIGHEST_ENTITY; i++) + { + CachedEntity *pEnt = ENTITY(i); + if (!CE_GOOD(pEnt)) + continue; + const model_t *model = RAW_ENT(pEnt)->GetModel(); + if (!model) + continue; + const char *model_name = g_IModelInfo->GetModelName(model); + if (strstr("models/props_gameplay/cap_point_base.mdl", model_name)) + pointarr[0] = model; + if (strstr("models/props_trainyard/bomb_cart.mdl", model_name)) + pointarr[1] = model; + if (strstr("models/props_2fort/trainwheel001.mdl", model_name)) + pointarr[2] = model; + if (strstr("models/custom/dirty_bomb_cart.mdl", model_name)) + pointarr[3] = model; + if (strstr("models/props_trainyard/bomb_cart_red.mdl", model_name)) + pointarr[4] = model; + } + bcalled = true; if (!master_switch) return; active = false; @@ -170,28 +188,6 @@ void CreateMove() if (!g_pUserCmd->command_number) return; int amount = 0; - if (!bcalled) - for (int i = 1; i < HIGHEST_ENTITY; i++) - { - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/props_gameplay/cap_point_base.mdl", model_name)) - pointarr[0] = model; - if (strstr("models/props_trainyard/bomb_cart.mdl", model_name)) - pointarr[1] = model; - if (strstr("models/props_2fort/trainwheel001.mdl", model_name)) - pointarr[2] = model; - if (strstr("models/custom/dirty_bomb_cart.mdl", model_name)) - pointarr[3] = model; - if (strstr("models/props_trainyard/bomb_cart_red.mdl", model_name)) - pointarr[4] = model; - } - bcalled = true; if (cart) { for (int i = 1; i < HIGHEST_ENTITY; i++) @@ -586,5 +582,3 @@ void Draw() #endif } } -} -} diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index 4a093b39..38004810 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -1,11 +1,7 @@ #include #include "hacks/LightESP.hpp" -namespace hacks -{ -namespace shared -{ -namespace lightesp +namespace hacks::shared::lightesp { static CatVar enable(CV_SWITCH, "lightesp_enabled", "0", "Enable LightESP", @@ -80,5 +76,3 @@ rgba_t LightESPColor(CachedEntity *ent) return colors::green; } } -} -} diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index 2d4aef06..e6d86fe0 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -19,11 +19,7 @@ #include "hack.hpp" #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace misc +namespace hacks::shared::misc { static CatVar debug_info(CV_SWITCH, "debug_info", "0", "Debug info", @@ -707,9 +703,7 @@ static CatCommand const char *ft = (args.ArgC() > 1 ? args[2] : 0); DumpRecvTable(ent, clz->m_pRecvTable, 0, ft, 0); }); -} // namespace misc -} // namespace shared -} // namespace hacks +} // namespace hacks::shared::misc /*void DumpRecvTable(CachedEntity* ent, RecvTable* table, int depth, const char* ft, unsigned acc_offset) { bool forcetable = ft && strlen(ft); if (!forcetable diff --git a/src/hacks/Noisemaker.cpp b/src/hacks/Noisemaker.cpp index 9eb3a403..786a4cd1 100755 --- a/src/hacks/Noisemaker.cpp +++ b/src/hacks/Noisemaker.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace noisemaker +namespace hacks::tf2::noisemaker { static CatVar @@ -33,5 +29,3 @@ void CreateMove() return; } } -} -} diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp index 60e73164..cf94cf12 100644 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -12,11 +12,7 @@ #ifndef FEATURE_RADAR_DISABLED #if ENABLE_VISUALS -namespace hacks -{ -namespace tf -{ -namespace radar +namespace hacks::tf::radar { static CatVar size(CV_INT, "radar_size", "300", "Radar size", @@ -280,8 +276,6 @@ void Draw() colors::Transparent(GUIColor(), 0.4f), 0.5f); } } -} -} #endif #endif diff --git a/src/hacks/SkinChanger.cpp b/src/hacks/SkinChanger.cpp index 26868c31..287c3a90 100644 --- a/src/hacks/SkinChanger.cpp +++ b/src/hacks/SkinChanger.cpp @@ -11,11 +11,7 @@ #include #include -namespace hacks -{ -namespace tf2 -{ -namespace skinchanger +namespace hacks::tf2::skinchanger { // Because fuck you, that's why. @@ -520,5 +516,3 @@ std::unordered_map modifier_map{}; // std::unordered_map cookie_map {}; patched_weapon_cookie cookie{ 0 }; } -} -} diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index 8bc0b4dc..4e6308a8 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -9,11 +9,7 @@ #include "common.hpp" #include "MiscTemporary.hpp" -namespace hacks -{ -namespace shared -{ -namespace spam +namespace hacks::shared::spam { static CatEnum spam_enum({ "DISABLED", "CUSTOM", "DEFAULT", "LENNYFACES", "BLANKS", "NULLCORE", "LMAOBOX", "LITHIUM" }); @@ -444,5 +440,3 @@ const std::vector builtin_lithium = { "GOT ROLLED BY LITHIUM? HEY, THAT MEANS IT'S TIME TO GET LITHIUMCHEAT!!" }; } -} -} diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp index c84aa783..3f75c971 100644 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -7,11 +7,7 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace spyalert +namespace hacks::tf::spyalert { static CatVar enabled(CV_SWITCH, "spyalert_enabled", "0", "Enable", @@ -116,5 +112,3 @@ void Draw() } } } -} -} diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index 12248732..2e1f1c12 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -10,11 +10,7 @@ #include "common.hpp" #include -namespace hacks -{ -namespace shared -{ -namespace triggerbot +namespace hacks::shared::triggerbot { // Vars for usersettings @@ -718,5 +714,3 @@ void Draw() { } } -} -} diff --git a/src/hacks/UberSpam.cpp b/src/hacks/UberSpam.cpp index ff280360..e27346a3 100755 --- a/src/hacks/UberSpam.cpp +++ b/src/hacks/UberSpam.cpp @@ -8,11 +8,7 @@ #include "common.hpp" #include -namespace hacks -{ -namespace tf -{ -namespace uberspam +namespace hacks::tf::uberspam { TextFile custom_lines; @@ -138,5 +134,3 @@ const std::vector builtin_nonecore = { ">>> RUMBLE COMPLETE! <<<", ">>> RUMBLE IS %i%% CHARGED! <<<" }; } -} -} diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index 2122b1ae..c15c0584 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -14,11 +14,7 @@ #include #include -namespace hacks -{ -namespace shared -{ -namespace walkbot +namespace hacks::shared::walkbot { using index_t = unsigned; @@ -1297,5 +1293,3 @@ void Move() } } } -} -} diff --git a/src/hacks/ac/aimbot.cpp b/src/hacks/ac/aimbot.cpp index 2201dcf8..9226a513 100644 --- a/src/hacks/ac/aimbot.cpp +++ b/src/hacks/ac/aimbot.cpp @@ -9,9 +9,7 @@ #include #include "common.hpp" -namespace ac -{ -namespace aimbot +namespace ac::aimbot { static CatVar enabled(CV_SWITCH, "ac_aimbot", "1", "Detect Aimbot", @@ -122,4 +120,3 @@ void Event(KeyValues *event) } } } -} diff --git a/src/hacks/ac/antiaim.cpp b/src/hacks/ac/antiaim.cpp index d0a8282c..5b9a430a 100755 --- a/src/hacks/ac/antiaim.cpp +++ b/src/hacks/ac/antiaim.cpp @@ -8,10 +8,9 @@ #include #include "common.hpp" -namespace ac -{ -namespace antiaim +namespace ac::antiaim { + static CatVar enabled(CV_SWITCH, "ac_antiaim", "1", "Detect Antiaim"); unsigned long last_accusation[32]{ 0 }; @@ -75,4 +74,4 @@ void Event(KeyValues *event) { } } -} + diff --git a/src/hacks/ac/bhop.cpp b/src/hacks/ac/bhop.cpp index 3c788db7..73f6ec0a 100755 --- a/src/hacks/ac/bhop.cpp +++ b/src/hacks/ac/bhop.cpp @@ -8,9 +8,7 @@ #include #include "common.hpp" -namespace ac -{ -namespace bhop +namespace ac::bhop { static CatVar bhop_detect_count(CV_INT, "ac_bhop_count", "4", @@ -83,4 +81,3 @@ void Event(KeyValues *event) { } } -} diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 6ec2fc93..5fffe5c7 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -89,6 +89,7 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd) #else #define antikick_time 90 #endif +const char *cmds[7] = {"use", "voicecommand", "spec_next", "spec_prev", "spec_player", "invprev", "invnext"}; namespace hooked_methods { DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, @@ -526,15 +527,23 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, g_Settings.last_angles = cmd->viewangles; } #endif - NET_StringCmd senddata(serverlag_string.GetString()); + int nextdata = 0; + NET_StringCmd senddata(cmds[nextdata]); INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); senddata.SetNetChannel(ch); senddata.SetReliable(false); if (servercrash && DelayTimer.check((int) delay * 1000)) { - for (int i = 0; i < 7800; i += sizeof(serverlag_string.GetString())) + for (int i = 0; i < 7800; i += sizeof(cmds[nextdata])) + { + senddata.m_szCommand = cmds[nextdata]; ch->SendNetMsg(senddata); + if (nextdata == 6) + nextdata = 0; + else + nextdata++; + } ch->Transmit(); } if (serverlag_amount || (votelogger::active && @@ -570,15 +579,29 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, if (prevflowticks <= 10) additionallag *= 0.1f; for (int i = 0; i < 7800 + additionallag; - i += sizeof(serverlag_string.GetString())) + i += sizeof(cmds[nextdata])) + { + senddata.m_szCommand = cmds[nextdata]; ch->SendNetMsg(senddata, false); + if (nextdata == 6) + nextdata = 0; + else + nextdata++; + } ch->Transmit(); } else if (!votelogger::active && serverlag_amount && DelayTimer.check((int) delay * 1000)) { for (int i = 0; i < (int) serverlag_amount; i++) + { + senddata.m_szCommand = cmds[nextdata]; + if (nextdata == 6) + nextdata = 0; + else + nextdata++; ch->SendNetMsg(senddata, false); + } ch->Transmit(); } prevflow = ch->GetAvgData(FLOW_INCOMING);