diff --git a/CMakeLists.txt b/CMakeLists.txt index ca19f3b8..602eecf6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,10 +110,6 @@ target_include_directories(cathook SYSTEM PRIVATE "external/source-sdk-2013-headers/mp/src/tier1" "external/source-sdk-2013-headers/mp/src") -target_include_directories(cathook PRIVATE "external/ucccccp") -target_include_directories(cathook PRIVATE "external/MicroPather") -target_include_directories(cathook PRIVATE "external/TF2_NavFile_Reader") - if(EnableWarnings) target_compile_options(cathook PRIVATE -Wall -Wextra) else() @@ -141,6 +137,7 @@ endif() add_subdirectory(src) add_subdirectory(include) +add_subdirectory(external) add_custom_command(TARGET cathook POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_SOURCE_DIR}/bin/$") diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100755 index 00000000..7393f200 --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,6 @@ +target_sources(cathook PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/MicroPather/micropather.cpp") + +target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/MicroPather") +target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/ucccccp") +target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/TF2_NavFile_Reader") diff --git a/external/TF2_NavFile_Reader b/external/TF2_NavFile_Reader index 65818ea2..d6816a1b 160000 --- a/external/TF2_NavFile_Reader +++ b/external/TF2_NavFile_Reader @@ -1 +1 @@ -Subproject commit 65818ea2cda4fa3f8e3f17e272692543f704d1f4 +Subproject commit d6816a1b67768227c7ed839fb7278fa47b63f643 diff --git a/include/PlayerTools.hpp b/include/PlayerTools.hpp old mode 100755 new mode 100644 index c26a2f38..a9a55ee9 --- a/include/PlayerTools.hpp +++ b/include/PlayerTools.hpp @@ -40,4 +40,4 @@ std::optional forceEspColor(CachedEntity *entity); #endif void onKilledBy(CachedEntity *entity); -} \ No newline at end of file +} // namespace player_tools \ No newline at end of file diff --git a/include/angles.hpp b/include/angles.hpp old mode 100755 new mode 100644 index ef574097..5d1e2369 --- a/include/angles.hpp +++ b/include/angles.hpp @@ -95,4 +95,4 @@ inline angle_data_s &data(const CachedEntity *entity) { return data_idx(entity->m_IDX); } -} +} // namespace angles diff --git a/include/backpacktf.hpp b/include/backpacktf.hpp old mode 100755 new mode 100644 index 4b64c931..bd869318 --- a/include/backpacktf.hpp +++ b/include/backpacktf.hpp @@ -32,4 +32,4 @@ struct backpack_data_s const backpack_data_s &get_data(unsigned id); void init(); bool enabled(); -} +} // namespace backpacktf diff --git a/include/chatstack.hpp b/include/chatstack.hpp old mode 100755 new mode 100644 index d0bcaa7f..ba0472ae --- a/include/chatstack.hpp +++ b/include/chatstack.hpp @@ -28,4 +28,4 @@ void Reset(); extern std::stack stack; extern float last_say; -} +} // namespace chat_stack diff --git a/include/classinfo/css.gen.hpp b/include/classinfo/css.gen.hpp old mode 100755 new mode 100644 index 1aeec8f5..ee8c13bf --- a/include/classinfo/css.gen.hpp +++ b/include/classinfo/css.gen.hpp @@ -494,6 +494,6 @@ public: }; extern css css_list; -} +} // namespace client_classes #endif /* css_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/css_constexpr.gen.hpp b/include/classinfo/css_constexpr.gen.hpp old mode 100755 new mode 100644 index 9555808c..e6a19cd8 --- a/include/classinfo/css_constexpr.gen.hpp +++ b/include/classinfo/css_constexpr.gen.hpp @@ -492,6 +492,6 @@ public: static constexpr int CCSGameRulesProxy = 26; static constexpr int CBaseCSGrenadeProjectile = 7; }; -} +} // namespace client_classes_constexpr #endif /* css_CONSTEXPR_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/dab.gen.hpp b/include/classinfo/dab.gen.hpp old mode 100755 new mode 100644 index 209be827..6b060275 --- a/include/classinfo/dab.gen.hpp +++ b/include/classinfo/dab.gen.hpp @@ -523,6 +523,6 @@ public: }; extern dab dab_list; -} +} // namespace client_classes #endif /* dab_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/dab_constexpr.gen.hpp b/include/classinfo/dab_constexpr.gen.hpp old mode 100755 new mode 100644 index d32604a4..ec441cbb --- a/include/classinfo/dab_constexpr.gen.hpp +++ b/include/classinfo/dab_constexpr.gen.hpp @@ -521,6 +521,6 @@ public: static constexpr int CBaseGrenadeProjectile = 12; static constexpr int CDAViewModel = 28; }; -} +} // namespace client_classes_constexpr #endif /* dab_CONSTEXPR_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/dummy.gen.hpp b/include/classinfo/dummy.gen.hpp old mode 100755 new mode 100644 index 3ffd67c3..dbc11006 --- a/include/classinfo/dummy.gen.hpp +++ b/include/classinfo/dummy.gen.hpp @@ -537,6 +537,6 @@ public: }; extern dummy dummy_list; -} +} // namespace client_classes #endif /* DUMMY_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/dynamic.gen.hpp b/include/classinfo/dynamic.gen.hpp old mode 100755 new mode 100644 index 63b912da..cace344e --- a/include/classinfo/dynamic.gen.hpp +++ b/include/classinfo/dynamic.gen.hpp @@ -539,6 +539,6 @@ public: }; extern dynamic dynamic_list; -} +} // namespace client_classes #endif /* DYNAMIC_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/hl2dm.gen.hpp b/include/classinfo/hl2dm.gen.hpp old mode 100755 new mode 100644 index 40ecd4bb..f6b97e0b --- a/include/classinfo/hl2dm.gen.hpp +++ b/include/classinfo/hl2dm.gen.hpp @@ -494,6 +494,6 @@ public: }; extern hl2dm hl2dm_list; -} +} // namespace client_classes #endif /* hl2dm_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/hl2dm_constexpr.gen.hpp b/include/classinfo/hl2dm_constexpr.gen.hpp old mode 100755 new mode 100644 index 57f928fb..f211b1ba --- a/include/classinfo/hl2dm_constexpr.gen.hpp +++ b/include/classinfo/hl2dm_constexpr.gen.hpp @@ -492,6 +492,6 @@ public: static constexpr int CCSGameRulesProxy = 0; static constexpr int CBaseCSGrenadeProjectile = 0; }; -} +} // namespace client_classes_constexpr #endif /* hl2dm_CONSTEXPR_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/tf2.gen.hpp b/include/classinfo/tf2.gen.hpp old mode 100755 new mode 100644 index 1d458d08..1748e0eb --- a/include/classinfo/tf2.gen.hpp +++ b/include/classinfo/tf2.gen.hpp @@ -537,6 +537,6 @@ public: }; extern tf2 tf2_list; -} +} // namespace client_classes #endif /* tf2_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/tf2_constexpr.gen.hpp b/include/classinfo/tf2_constexpr.gen.hpp old mode 100755 new mode 100644 index 8be2ba35..a53ac3ef --- a/include/classinfo/tf2_constexpr.gen.hpp +++ b/include/classinfo/tf2_constexpr.gen.hpp @@ -535,6 +535,6 @@ public: static constexpr int CTFPointManager = 249; static constexpr int CTFFlameManager = 205; }; -} +} // namespace client_classes_constexpr #endif /* tf2_CONSTEXPR_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/tf2c.gen.hpp b/include/classinfo/tf2c.gen.hpp old mode 100755 new mode 100644 index a7d4d780..4b1bf0f1 --- a/include/classinfo/tf2c.gen.hpp +++ b/include/classinfo/tf2c.gen.hpp @@ -494,6 +494,6 @@ public: }; extern tf2c tf2c_list; -} +} // namespace client_classes #endif /* tf2c_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/classinfo/tf2c_constexpr.gen.hpp b/include/classinfo/tf2c_constexpr.gen.hpp old mode 100755 new mode 100644 index d08ef697..16830e45 --- a/include/classinfo/tf2c_constexpr.gen.hpp +++ b/include/classinfo/tf2c_constexpr.gen.hpp @@ -492,6 +492,6 @@ public: static constexpr int CCSGameRulesProxy = 0; static constexpr int CBaseCSGrenadeProjectile = 0; }; -} +} // namespace client_classes_constexpr #endif /* tf2c_CONSTEXPR_AUTOGEN_HPP */ \ No newline at end of file diff --git a/include/core/interfaces.hpp b/include/core/interfaces.hpp old mode 100755 new mode 100644 index ea95d51d..9daf27d0 --- a/include/core/interfaces.hpp +++ b/include/core/interfaces.hpp @@ -14,7 +14,7 @@ namespace vgui { class ISurface; class IPanel; -} +} // namespace vgui class ISteamClient; class ISteamFriends; diff --git a/include/core/sharedobj.hpp b/include/core/sharedobj.hpp old mode 100755 new mode 100644 index 7211e977..3028f681 --- a/include/core/sharedobj.hpp +++ b/include/core/sharedobj.hpp @@ -52,4 +52,4 @@ SharedObject &libsdl(); #endif void LoadAllSharedObjects(); -} +} // namespace sharedobj diff --git a/include/crits.hpp b/include/crits.hpp old mode 100755 new mode 100644 index 6525135a..263ff0b3 --- a/include/crits.hpp +++ b/include/crits.hpp @@ -31,7 +31,7 @@ namespace criticals void create_move(); void draw(); bool random_crits_enabled(); -} +} // namespace criticals #include diff --git a/include/entitycache.hpp b/include/entitycache.hpp old mode 100755 new mode 100644 index 14117f99..6ba396b6 --- a/include/entitycache.hpp +++ b/include/entitycache.hpp @@ -232,4 +232,4 @@ inline CachedEntity &Get(int idx) void Update(); void Invalidate(); extern int max; -} +} // namespace entity_cache diff --git a/include/entityhitboxcache.hpp b/include/entityhitboxcache.hpp old mode 100755 new mode 100644 index 2d24a031..0e30cab5 --- a/include/entityhitboxcache.hpp +++ b/include/entityhitboxcache.hpp @@ -67,4 +67,4 @@ inline EntityHitboxCache &Get(unsigned i) "Requested out-of-range entity hitbox cache entry!"); return array[i]; } -} +} // namespace hitbox_cache diff --git a/include/hack.hpp b/include/hack.hpp old mode 100755 new mode 100644 index 41283ba3..5465a0aa --- a/include/hack.hpp +++ b/include/hack.hpp @@ -33,4 +33,4 @@ const std::string &GetType(); void Initialize(); void Think(); void Shutdown(); -} +} // namespace hack diff --git a/include/hacks/Achievement.hpp b/include/hacks/Achievement.hpp old mode 100755 new mode 100644 index 1ad869b5..5a040a21 --- a/include/hacks/Achievement.hpp +++ b/include/hacks/Achievement.hpp @@ -12,4 +12,4 @@ namespace hacks::tf2::achievement void Lock(); void Unlock(); -} +} // namespace hacks::tf2::achievement diff --git a/include/hacks/Aimbot.hpp b/include/hacks/Aimbot.hpp old mode 100755 new mode 100644 index b0e8efab..51c0fe3f --- a/include/hacks/Aimbot.hpp +++ b/include/hacks/Aimbot.hpp @@ -57,4 +57,4 @@ int ClosestHitbox(CachedEntity *target); void DoSlowAim(Vector &inputAngle); bool UpdateAimkey(); float EffectiveTargetingRange(); -} +} // namespace hacks::shared::aimbot diff --git a/include/hacks/Announcer.hpp b/include/hacks/Announcer.hpp old mode 100755 new mode 100644 index 9763cae6..b664178c --- a/include/hacks/Announcer.hpp +++ b/include/hacks/Announcer.hpp @@ -15,4 +15,4 @@ namespace hacks::shared::announcer void playsound(const std::string &); void init(); void shutdown(); -} +} // namespace hacks::shared::announcer diff --git a/include/hacks/AntiAim.hpp b/include/hacks/AntiAim.hpp old mode 100755 new mode 100644 index 0bb74e53..645ffd08 --- a/include/hacks/AntiAim.hpp +++ b/include/hacks/AntiAim.hpp @@ -16,4 +16,4 @@ void SetSafeSpace(int safespace); bool ShouldAA(CUserCmd *cmd); void ProcessUserCmd(CUserCmd *cmd); bool isEnabled(); -} +} // namespace hacks::shared::antiaim diff --git a/include/hacks/AntiAntiAim.hpp b/include/hacks/AntiAntiAim.hpp old mode 100755 new mode 100644 index f4b06c11..da8a5a9c --- a/include/hacks/AntiAntiAim.hpp +++ b/include/hacks/AntiAntiAim.hpp @@ -16,4 +16,4 @@ 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/hacks/AntiBackstab.hpp b/include/hacks/AntiBackstab.hpp old mode 100755 new mode 100644 index 21eaee94..066c956e --- a/include/hacks/AntiBackstab.hpp +++ b/include/hacks/AntiBackstab.hpp @@ -15,4 +15,4 @@ extern bool noaa; void CreateMove(); void PaintTraverse(); -} +} // namespace hacks::tf2::antibackstab diff --git a/include/hacks/AntiCheat.hpp b/include/hacks/AntiCheat.hpp old mode 100755 new mode 100644 index a992e49f..df20a947 --- a/include/hacks/AntiCheat.hpp +++ b/include/hacks/AntiCheat.hpp @@ -21,4 +21,4 @@ void CreateMove(); void SetRage(player_info_t info); void ResetPlayer(int index); void ResetEverything(); -} +} // namespace hacks::shared::anticheat diff --git a/include/hacks/AutoBackstab.hpp b/include/hacks/AutoBackstab.hpp old mode 100755 new mode 100644 index d777510f..c19e699d --- a/include/hacks/AutoBackstab.hpp +++ b/include/hacks/AutoBackstab.hpp @@ -12,4 +12,4 @@ namespace hacks::tf2::autobackstab void CreateMove(); const Vector GetWorldSpaceCenter(CachedEntity *ent); -} +} // namespace hacks::tf2::autobackstab diff --git a/include/hacks/AutoHeal.hpp b/include/hacks/AutoHeal.hpp old mode 100755 new mode 100644 index 53b3ba3d..406b23e1 --- a/include/hacks/AutoHeal.hpp +++ b/include/hacks/AutoHeal.hpp @@ -30,4 +30,4 @@ void UpdateData(); int BestTarget(); int HealingPriority(int idx); bool CanHeal(int idx); -} +} // namespace hacks::tf::autoheal diff --git a/include/hacks/AutoJoin.hpp b/include/hacks/AutoJoin.hpp old mode 100755 new mode 100644 index 7a32e171..bc633718 --- a/include/hacks/AutoJoin.hpp +++ b/include/hacks/AutoJoin.hpp @@ -14,4 +14,4 @@ void resetQueueTimer(); void update(); void updateSearch(); void onShutdown(); -} +} // namespace hacks::shared::autojoin diff --git a/include/hacks/AutoReflect.hpp b/include/hacks/AutoReflect.hpp old mode 100755 new mode 100644 index 5ed509fd..75ab4b2b --- a/include/hacks/AutoReflect.hpp +++ b/include/hacks/AutoReflect.hpp @@ -15,4 +15,4 @@ void Draw(); void CreateMove(); bool ShouldReflect(CachedEntity *ent); bool IsEntStickyBomb(CachedEntity *ent); -} +} // namespace hacks::tf::autoreflect diff --git a/include/hacks/AutoSticky.hpp b/include/hacks/AutoSticky.hpp old mode 100755 new mode 100644 index c65c4e31..36d00fd7 --- a/include/hacks/AutoSticky.hpp +++ b/include/hacks/AutoSticky.hpp @@ -13,4 +13,4 @@ namespace hacks::tf::autosticky { bool ShouldDetonate(CachedEntity *bomb); void CreateMove(); -} +} // namespace hacks::tf::autosticky diff --git a/include/hacks/Backtrack.hpp b/include/hacks/Backtrack.hpp old mode 100755 new mode 100644 index cfe50210..a71b2fcb --- a/include/hacks/Backtrack.hpp +++ b/include/hacks/Backtrack.hpp @@ -64,4 +64,4 @@ extern bool isBacktrackEnabled; float getLatency(); int getTicks(); bool ValidTick(BacktrackData &i, CachedEntity *ent); -} +} // namespace hacks::shared::backtrack diff --git a/include/hacks/CMakeLists.txt b/include/hacks/CMakeLists.txt index cf3677eb..df18df8e 100755 --- a/include/hacks/CMakeLists.txt +++ b/include/hacks/CMakeLists.txt @@ -30,6 +30,7 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp" "${CMAKE_CURRENT_LIST_DIR}/LightESP.hpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.hpp" + "${CMAKE_CURRENT_LIST_DIR}/NavBot.hpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp" "${CMAKE_CURRENT_LIST_DIR}/Spam.hpp" "${CMAKE_CURRENT_LIST_DIR}/Trigger.hpp" diff --git a/include/hacks/CatBot.hpp b/include/hacks/CatBot.hpp old mode 100755 new mode 100644 index 787dd13e..87deafdf --- a/include/hacks/CatBot.hpp +++ b/include/hacks/CatBot.hpp @@ -21,4 +21,4 @@ void level_init(); #if ENABLE_IPC void update_ipc_data(ipc::user_data_s &data); #endif -} +} // namespace hacks::shared::catbot diff --git a/include/hacks/ESP.hpp b/include/hacks/ESP.hpp old mode 100755 new mode 100644 index dfab1d5d..5f02a774 --- a/include/hacks/ESP.hpp +++ b/include/hacks/ESP.hpp @@ -58,4 +58,4 @@ void AddEntityString(CachedEntity *entity, const std::string &string, const rgba_t &color = colors::empty); void SetEntityColor(CachedEntity *entity, const rgba_t &color); void ResetEntityStrings(); -} +} // namespace hacks::shared::esp diff --git a/include/hacks/FollowBot.hpp b/include/hacks/FollowBot.hpp old mode 100755 new mode 100644 index 6b28f92d..d2dd196c --- a/include/hacks/FollowBot.hpp +++ b/include/hacks/FollowBot.hpp @@ -16,4 +16,4 @@ int ClassPriority(CachedEntity *ent); bool isEnabled(); int getTarget(); -} +} // namespace hacks::shared::followbot diff --git a/include/hacks/KillSay.hpp b/include/hacks/KillSay.hpp old mode 100755 new mode 100644 index a05e7642..064d4143 --- a/include/hacks/KillSay.hpp +++ b/include/hacks/KillSay.hpp @@ -19,4 +19,4 @@ void reload(); extern const std::vector builtin_default; extern const std::vector builtin_nonecore_offensive; extern const std::vector builtin_nonecore_mlg; -} +} // namespace hacks::shared::killsay diff --git a/include/hacks/Killstreak.hpp b/include/hacks/Killstreak.hpp old mode 100755 new mode 100644 index df309f4c..dc9f4dad --- a/include/hacks/Killstreak.hpp +++ b/include/hacks/Killstreak.hpp @@ -17,4 +17,4 @@ void init(); void shutdown(); void fire_event(IGameEvent *event); void apply_killstreaks(); -} +} // namespace hacks::tf2::killstreak diff --git a/include/hacks/LightESP.hpp b/include/hacks/LightESP.hpp old mode 100755 new mode 100644 index 6a01b6ed..2e1ec2aa --- a/include/hacks/LightESP.hpp +++ b/include/hacks/LightESP.hpp @@ -5,4 +5,4 @@ namespace hacks::shared::lightesp void run(); void draw(); rgba_t LightESPColor(CachedEntity *ent); -} +} // namespace hacks::shared::lightesp diff --git a/include/hacks/Misc.hpp b/include/hacks/Misc.hpp old mode 100755 new mode 100644 index 8ade5e8d..b48c31fe --- a/include/hacks/Misc.hpp +++ b/include/hacks/Misc.hpp @@ -21,4 +21,4 @@ void DrawText(); extern int last_number; extern float last_bucket; -} +} // namespace hacks::shared::misc diff --git a/include/hacks/NavBot.hpp b/include/hacks/NavBot.hpp new file mode 100644 index 00000000..4b12c2c4 --- /dev/null +++ b/include/hacks/NavBot.hpp @@ -0,0 +1,12 @@ +// +// Created by bencat07 on 17.08.18. +// +#pragma once + +#include "common.hpp" +#include "config.h" +namespace hacks::tf2::NavBot +{ +void Init(); +void CreateMove(); +} \ No newline at end of file diff --git a/include/hacks/Radar.hpp b/include/hacks/Radar.hpp old mode 100755 new mode 100644 index 85e8da07..dc0a2ff6 --- a/include/hacks/Radar.hpp +++ b/include/hacks/Radar.hpp @@ -14,5 +14,5 @@ namespace hacks::tf::radar { std::pair WorldToRadar(int x, int y); void Draw(); -} +} // namespace hacks::tf::radar #endif diff --git a/include/hacks/SeedPrediction.hpp b/include/hacks/SeedPrediction.hpp old mode 100755 new mode 100644 index 6efb2d21..add7124e --- a/include/hacks/SeedPrediction.hpp +++ b/include/hacks/SeedPrediction.hpp @@ -51,4 +51,4 @@ extern buf2 rebased; extern buf3 intervals; void selectBase(); double predictOffset(const seedstruct &entry, int targetTick, double clockRes); -} +} // namespace hacks::tf2::seedprediction diff --git a/include/hacks/SkinChanger.hpp b/include/hacks/SkinChanger.hpp old mode 100755 new mode 100644 index 07c629ef..fad8ee06 --- a/include/hacks/SkinChanger.hpp +++ b/include/hacks/SkinChanger.hpp @@ -137,4 +137,4 @@ void Load(std::string filename, bool merge = false); void InvalidateCookie(); void FrameStageNotify(int stage); void DrawText(); -} +} // namespace hacks::tf2::skinchanger diff --git a/include/hacks/Spam.hpp b/include/hacks/Spam.hpp old mode 100755 new mode 100644 index 3bba268a..907bf1c4 --- a/include/hacks/Spam.hpp +++ b/include/hacks/Spam.hpp @@ -25,4 +25,4 @@ bool isActive(); void init(); void createMove(); void reload(); -} +} // namespace hacks::shared::spam diff --git a/include/hacks/Trigger.hpp b/include/hacks/Trigger.hpp old mode 100755 new mode 100644 index 6059a9c9..b4d0c851 --- a/include/hacks/Trigger.hpp +++ b/include/hacks/Trigger.hpp @@ -22,4 +22,4 @@ bool UpdateAimkey(); float EffectiveTargetingRange(); void Draw(); bool CheckLineBox(Vector B1, Vector B2, Vector L1, Vector L2, Vector &Hit); -} +} // namespace hacks::shared::triggerbot diff --git a/include/hacks/UberSpam.hpp b/include/hacks/UberSpam.hpp old mode 100755 new mode 100644 index e5e41428..55548262 --- a/include/hacks/UberSpam.hpp +++ b/include/hacks/UberSpam.hpp @@ -18,4 +18,4 @@ void CreateMove(); extern const std::vector builtin_cathook; extern const std::vector builtin_nonecore; -} +} // namespace hacks::tf::uberspam diff --git a/include/hacks/Walkbot.hpp b/include/hacks/Walkbot.hpp old mode 100755 new mode 100644 index c114035c..ff75b245 --- a/include/hacks/Walkbot.hpp +++ b/include/hacks/Walkbot.hpp @@ -18,4 +18,4 @@ void Draw(); #endif void Move(); void OnLevelInit(); -} +} // namespace hacks::shared::walkbot diff --git a/include/hacks/ac/aimbot.hpp b/include/hacks/ac/aimbot.hpp old mode 100755 new mode 100644 index 6846feda..57d50520 --- a/include/hacks/ac/aimbot.hpp +++ b/include/hacks/ac/aimbot.hpp @@ -29,4 +29,4 @@ void ResetPlayer(int idx); void Init(); void Update(CachedEntity *player); void Event(KeyValues *event); -} +} // namespace ac::aimbot diff --git a/include/hacks/ac/antiaim.hpp b/include/hacks/ac/antiaim.hpp old mode 100755 new mode 100644 index 241f3b5e..89b4868f --- a/include/hacks/ac/antiaim.hpp +++ b/include/hacks/ac/antiaim.hpp @@ -20,4 +20,4 @@ void ResetPlayer(int idx); void Init(); void Update(CachedEntity *player); void Event(KeyValues *event); -} +} // namespace ac::antiaim diff --git a/include/hacks/ac/bhop.hpp b/include/hacks/ac/bhop.hpp old mode 100755 new mode 100644 index 00bf44a5..8130c3a6 --- a/include/hacks/ac/bhop.hpp +++ b/include/hacks/ac/bhop.hpp @@ -27,4 +27,4 @@ void ResetPlayer(int idx); void Init(); void Update(CachedEntity *player); void Event(KeyValues *event); -} +} // namespace ac::bhop diff --git a/include/hacks/hacklist.hpp b/include/hacks/hacklist.hpp index d26947aa..1c360aaa 100755 --- a/include/hacks/hacklist.hpp +++ b/include/hacks/hacklist.hpp @@ -36,6 +36,7 @@ #endif #if not LAGBOT_MODE #include "Walkbot.hpp" +#include "navparser.hpp" #endif #include "AutoJoin.hpp" #if not LAGBOT_MODE @@ -50,6 +51,7 @@ #endif #include "Spam.hpp" #if not LAGBOT_MODE +#include "NavBot.hpp" #include "Noisemaker.hpp" #include "FollowBot.hpp" #include "Announcer.hpp" diff --git a/include/hitrate.hpp b/include/hitrate.hpp old mode 100755 new mode 100644 index 351b3e9c..337d7617 --- a/include/hitrate.hpp +++ b/include/hitrate.hpp @@ -15,4 +15,4 @@ extern int count_hits; extern int count_hits_head; void Update(); -} +} // namespace hitrate diff --git a/include/hooks.hpp b/include/hooks.hpp old mode 100755 new mode 100644 index ae7d1f2c..3bdf2eec --- a/include/hooks.hpp +++ b/include/hooks.hpp @@ -73,4 +73,4 @@ extern VMTHook materialsystem; extern VMTHook enginevgui; extern VMTHook vstd; extern VMTHook eventmanager2; -} +} // namespace hooks diff --git a/include/hooks/HookedMethods.hpp b/include/hooks/HookedMethods.hpp old mode 100755 new mode 100644 index 9754e416..4e71a2ef --- a/include/hooks/HookedMethods.hpp +++ b/include/hooks/HookedMethods.hpp @@ -88,7 +88,7 @@ DECLARE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *); // IUniformRandomStream DECLARE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *, int, int); #endif -} +} // namespace hooked_methods // TODO // wontfix.club diff --git a/include/https_request.hpp b/include/https_request.hpp old mode 100755 new mode 100644 index f290ccb1..b087a345 --- a/include/https_request.hpp +++ b/include/https_request.hpp @@ -37,4 +37,4 @@ public: }; void initialize(); -} +} // namespace https diff --git a/include/ipc.hpp b/include/ipc.hpp old mode 100755 new mode 100644 index 2d62244f..de723808 --- a/include/ipc.hpp +++ b/include/ipc.hpp @@ -29,7 +29,7 @@ constexpr unsigned execute_client_cmd_long = 3; constexpr unsigned move_to_vector = 4; constexpr unsigned stop_moving = 5; constexpr unsigned start_moving = 6; -} +} // namespace commands constexpr unsigned cathook_magic_number = 0x0DEADCA7; @@ -103,6 +103,6 @@ void UpdateTemporaryData(); void UpdateServerAddress(bool shutdown = false); void StoreClientData(); void UpdatePlayerlist(); -} +} // namespace ipc #endif diff --git a/include/json.hpp b/include/json.hpp old mode 100755 new mode 100644 index d1068af3..0b79a44e --- a/include/json.hpp +++ b/include/json.hpp @@ -44,13 +44,13 @@ SOFTWARE. #include // initializer_list #include // setw #include // istream, ostream -#include // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator -#include // numeric_limits -#include // locale -#include // map -#include // addressof, allocator, allocator_traits, unique_ptr -#include // accumulate -#include // stringstream +#include // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator +#include // numeric_limits +#include // locale +#include // map +#include // addressof, allocator, allocator_traits, unique_ptr +#include // accumulate +#include // stringstream #include // domain_error, invalid_argument, out_of_range #include // getline, stoi, string, to_string #include // add_pointer, conditional, decay, enable_if, false_type, integral_constant, is_arithmetic, is_base_of, is_const, is_constructible, is_convertible, is_default_constructible, is_enum, is_floating_point, is_integral, is_nothrow_move_assignable, is_nothrow_move_constructible, is_pointer, is_reference, is_same, is_scalar, is_signed, remove_const, remove_cv, remove_pointer, remove_reference, true_type, underlying_type @@ -208,8 +208,9 @@ using uncvref_t = // taken from http://stackoverflow.com/a/26936864/266378 template -using is_unscoped_enum = std::integral_constant< - bool, std::is_convertible::value and std::is_enum::value>; +using is_unscoped_enum = + std::integral_constant::value and + std::is_enum::value>; /* Implementation of two C++17 constructs: conjunction, negation. This is needed @@ -498,11 +499,10 @@ template struct has_from_json { private: // also check the return type of from_json - template ::from_json( - std::declval(), - std::declval()))>::value>> + template ::from_json( + std::declval(), + std::declval()))>::value>> static int detect(U &&); static void detect(...); @@ -517,10 +517,9 @@ public: template struct has_non_default_from_json { private: - template ::from_json( - std::declval()))>::value>> + template ::from_json( + std::declval()))>::value>> static int detect(U &&); static void detect(...); @@ -969,7 +968,7 @@ namespace constexpr const auto &to_json = detail::static_const::value; constexpr const auto &from_json = detail::static_const::value; -} +} // namespace /*! @brief default JSONSerializer template argument @@ -1226,7 +1225,7 @@ public: #ifdef _WIN32 result["platform"] = "win32"; #elif defined __linux__ - result["platform"] = "linux"; + result["platform"] = "linux"; #elif defined __APPLE__ result["platform"] = "apple"; #elif defined __unix__ @@ -1239,7 +1238,7 @@ public: result["compiler"] = { { "family", "clang" }, { "version", __clang_version__ } }; #elif defined(__ICC) || defined(__INTEL_COMPILER) - result["compiler"] = { { "family", "icc" }, + result["compiler"] = { { "family", "icc" }, { "version", __INTEL_COMPILER } }; #elif defined(__GNUC__) || defined(__GNUG__) result["compiler"] = { { "family", "gcc" }, @@ -3391,7 +3390,7 @@ public: */ template < typename ValueTypeCV, - typename ValueType = detail::uncvref_t, + typename ValueType = detail::uncvref_t, detail::enable_if_t::value and detail::has_non_default_from_json< basic_json_t, ValueType>::value, @@ -3613,19 +3612,19 @@ public: @since version 1.0.0 */ - template ::value and - not std::is_same::value + template < + typename ValueType, + typename std::enable_if< + not std::is_pointer::value and + not std::is_same::value #ifndef _MSC_VER // fix for issue #167 operator<< ambiguity under VS2015 - and - not std::is_same< - ValueType, std::initializer_list< + and not std::is_same>::value #endif - , - int>::type = 0> + , + int>::type = 0> operator ValueType() const { // delegate the call to get<>() const @@ -6632,9 +6631,8 @@ public: assert(std::accumulate( first, last, std::pair(true, 0), [&first](std::pair res, decltype(*first) val) { - res.first &= - (val == - *(std::next(std::addressof(*first), res.second++))); + res.first &= (val == *(std::next(std::addressof(*first), + res.second++))); return res; }) .first); @@ -10299,7 +10297,7 @@ private: } basic_json_parser_9: yyaccept = 0; - yych = *(m_marker = ++m_cursor); + yych = *(m_marker = ++m_cursor); if (yych <= 0x1F) { goto basic_json_parser_5; @@ -10340,7 +10338,7 @@ private: goto basic_json_parser_5; basic_json_parser_13: yyaccept = 1; - yych = *(m_marker = ++m_cursor); + yych = *(m_marker = ++m_cursor); if (yych <= '9') { if (yych == '.') @@ -10426,7 +10424,7 @@ private: } basic_json_parser_23: yyaccept = 0; - yych = *(m_marker = ++m_cursor); + yych = *(m_marker = ++m_cursor); if (yych == 'a') { goto basic_json_parser_52; @@ -10434,7 +10432,7 @@ private: goto basic_json_parser_5; basic_json_parser_24: yyaccept = 0; - yych = *(m_marker = ++m_cursor); + yych = *(m_marker = ++m_cursor); if (yych == 'u') { goto basic_json_parser_53; @@ -10442,7 +10440,7 @@ private: goto basic_json_parser_5; basic_json_parser_25: yyaccept = 0; - yych = *(m_marker = ++m_cursor); + yych = *(m_marker = ++m_cursor); if (yych == 'r') { goto basic_json_parser_54; @@ -10748,7 +10746,7 @@ private: goto basic_json_parser_32; basic_json_parser_43: yyaccept = 2; - yych = *(m_marker = ++m_cursor); + yych = *(m_marker = ++m_cursor); if (yych <= '9') { if (yych == '.') @@ -11465,9 +11463,8 @@ private: @param[in,out] val shall contain parsed value, or undefined value if could not parse */ - template ::value>::type> + template ::value>::type> bool to(T &val) const { return parse(val, std::is_integral()); @@ -12517,7 +12514,7 @@ public: pos != std::string::npos; // make sure f was found s.replace(pos, f.size(), t), // replace with t pos = s.find(f, pos + t.size()) // find next occurrence of f - ) + ) ; } diff --git a/include/navparser.hpp b/include/navparser.hpp old mode 100755 new mode 100644 index e69de29b..54c8ba3a --- a/include/navparser.hpp +++ b/include/navparser.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "common.hpp" +#include "micropather.h" +#include "pwd.h" + +namespace nav +{ +extern bool init; +extern bool ReadyForCommands; +extern std::vector areas; +std::vector findPath(Vector loc, Vector dest); +bool NavTo(Vector dest, bool navToLocalCenter = true, bool persistent = true); +int findClosestNavSquare(Vector vec); +bool Prepare(); +void CreateMove(); +} // namespace nav diff --git a/include/online/Online.hpp b/include/online/Online.hpp old mode 100755 new mode 100644 index 95f91d72..e1db6908 --- a/include/online/Online.hpp +++ b/include/online/Online.hpp @@ -34,4 +34,4 @@ struct user_data void update(); user_data *getUserData(unsigned steamId); -} +} // namespace online diff --git a/include/playerlist.hpp b/include/playerlist.hpp old mode 100755 new mode 100644 index db4a9b2e..96783c81 --- a/include/playerlist.hpp +++ b/include/playerlist.hpp @@ -26,7 +26,7 @@ enum class k_EState }; extern rgba_t k_Colors[]; -const std::string k_Names[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", +const std::string k_Names[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", "DEVELOPER" }; const char *const k_pszNames[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", "DEVELOPER" }; @@ -57,4 +57,4 @@ userdata &AccessData(unsigned steamid); userdata &AccessData(CachedEntity *player); bool IsDefault(unsigned steamid); bool IsDefault(CachedEntity *player); -} +} // namespace playerlist diff --git a/include/prediction.hpp b/include/prediction.hpp old mode 100755 new mode 100644 index b3a41c28..812faae9 --- a/include/prediction.hpp +++ b/include/prediction.hpp @@ -1,9 +1,9 @@ /* -*prediction.h -* -* Created on: Dec 5, 2016 -* Author: nullifiedcat -*/ + *prediction.h + * + * Created on: Dec 5, 2016 + * Author: nullifiedcat + */ #pragma once diff --git a/include/reclasses/CTFGCClientSystem.hpp b/include/reclasses/CTFGCClientSystem.hpp old mode 100755 new mode 100644 index 4a9cc6e1..e1523ea6 --- a/include/reclasses/CTFGCClientSystem.hpp +++ b/include/reclasses/CTFGCClientSystem.hpp @@ -25,4 +25,4 @@ public: CTFParty *GetParty(); int JoinMMMatch(); }; -} +} // namespace re diff --git a/include/reclasses/CTFInventoryManager.hpp b/include/reclasses/CTFInventoryManager.hpp old mode 100755 new mode 100644 index 8ddbc726..8cb94513 --- a/include/reclasses/CTFInventoryManager.hpp +++ b/include/reclasses/CTFInventoryManager.hpp @@ -32,4 +32,4 @@ public: public: CEconItem *GetFirstItemOfItemDef(int id); }; -} +} // namespace re diff --git a/include/reclasses/CTFParty.hpp b/include/reclasses/CTFParty.hpp old mode 100755 new mode 100644 index 2b8d639e..003d30f1 --- a/include/reclasses/CTFParty.hpp +++ b/include/reclasses/CTFParty.hpp @@ -23,4 +23,4 @@ public: return *((int *) party + 19); } }; -} +} // namespace re diff --git a/include/reclasses/CTFPartyClient.hpp b/include/reclasses/CTFPartyClient.hpp old mode 100755 new mode 100644 index 77eb23da..b901eb30 --- a/include/reclasses/CTFPartyClient.hpp +++ b/include/reclasses/CTFPartyClient.hpp @@ -26,4 +26,4 @@ public: int BRequestJoinPlayer(CSteamID steamid); static bool BInQueue(CTFPartyClient *this_); }; -} +} // namespace re diff --git a/include/reclasses/CTFPlayerShared.hpp b/include/reclasses/CTFPlayerShared.hpp old mode 100755 new mode 100644 index 455136b2..041334d1 --- a/include/reclasses/CTFPlayerShared.hpp +++ b/include/reclasses/CTFPlayerShared.hpp @@ -20,4 +20,4 @@ public: return false; } }; -} +} // namespace re diff --git a/include/reclasses/C_BaseCombatWeapon.hpp b/include/reclasses/C_BaseCombatWeapon.hpp old mode 100755 new mode 100644 index 0c409db4..1a5e69a4 --- a/include/reclasses/C_BaseCombatWeapon.hpp +++ b/include/reclasses/C_BaseCombatWeapon.hpp @@ -37,4 +37,4 @@ public: 0)(self); } }; -} +} // namespace re diff --git a/include/reclasses/C_BaseEntity.hpp b/include/reclasses/C_BaseEntity.hpp old mode 100755 new mode 100644 index a121bfed..a6a7eeba --- a/include/reclasses/C_BaseEntity.hpp +++ b/include/reclasses/C_BaseEntity.hpp @@ -39,4 +39,4 @@ public: return SetAbsOrigin_fn(self, origin); } }; -} +} // namespace re diff --git a/include/reclasses/C_BasePlayer.hpp b/include/reclasses/C_BasePlayer.hpp old mode 100755 new mode 100644 index c6d36b4d..0b489258 --- a/include/reclasses/C_BasePlayer.hpp +++ b/include/reclasses/C_BasePlayer.hpp @@ -13,4 +13,4 @@ public: return *((CTFPlayerShared *) (unsigned(self) + 6092)); } }; -} +} // namespace re diff --git a/include/reclasses/C_MannVsMachineStats.hpp b/include/reclasses/C_MannVsMachineStats.hpp old mode 100755 new mode 100644 index a467409a..fdc505ef --- a/include/reclasses/C_MannVsMachineStats.hpp +++ b/include/reclasses/C_MannVsMachineStats.hpp @@ -20,4 +20,4 @@ public: public: int *AddLocalPlayerUpgrade(int id, int &a3); }; -} +} // namespace re diff --git a/include/reclasses/C_TFWeaponBase.hpp b/include/reclasses/C_TFWeaponBase.hpp old mode 100755 new mode 100644 index 54af6b81..021b0f54 --- a/include/reclasses/C_TFWeaponBase.hpp +++ b/include/reclasses/C_TFWeaponBase.hpp @@ -186,4 +186,4 @@ public: return *(float *) (unsigned(self) + 2616u); } }; -} +} // namespace re diff --git a/include/reclasses/C_TFWeaponBaseGun.hpp b/include/reclasses/C_TFWeaponBaseGun.hpp old mode 100755 new mode 100644 index 9fb3300d..5aeca894 --- a/include/reclasses/C_TFWeaponBaseGun.hpp +++ b/include/reclasses/C_TFWeaponBaseGun.hpp @@ -37,4 +37,4 @@ public: 0)(self); } }; -} +} // namespace re diff --git a/include/reclasses/C_TFWeaponBaseMelee.hpp b/include/reclasses/C_TFWeaponBaseMelee.hpp old mode 100755 new mode 100644 index 71e13e86..da28d432 --- a/include/reclasses/C_TFWeaponBaseMelee.hpp +++ b/include/reclasses/C_TFWeaponBaseMelee.hpp @@ -31,4 +31,4 @@ public: return (128.0f * 0.67) - 0.5f; } }; -} +} // namespace re diff --git a/include/reclasses/ITFGroupMatchCriteria.hpp b/include/reclasses/ITFGroupMatchCriteria.hpp old mode 100755 new mode 100644 index 68fb39bc..4f785da1 --- a/include/reclasses/ITFGroupMatchCriteria.hpp +++ b/include/reclasses/ITFGroupMatchCriteria.hpp @@ -31,4 +31,4 @@ public: public: static int SetMatchGroup(ITFGroupMatchCriteria *this_, int group); }; -} +} // namespace re diff --git a/include/sconvars.hpp b/include/sconvars.hpp old mode 100755 new mode 100644 index 195e9190..1f5198f2 --- a/include/sconvars.hpp +++ b/include/sconvars.hpp @@ -26,4 +26,4 @@ public: ConVar *original; ConVar *spoof; }; -} +} // namespace sconvar diff --git a/include/sdk/igamemovement.h b/include/sdk/igamemovement.h old mode 100755 new mode 100644 index 1f3fb07d..8e447099 --- a/include/sdk/igamemovement.h +++ b/include/sdk/igamemovement.h @@ -120,9 +120,9 @@ public: // Process the current movement command virtual void ProcessMovement(CBasePlayer * pPlayer, CMoveData * pMove) = 0; - virtual void StartTrackPredictionErrors(CBasePlayer * pPlayer) = 0; - virtual void FinishTrackPredictionErrors(CBasePlayer * pPlayer) = 0; - virtual void DiffPrint(PRINTF_FORMAT_STRING char const *fmt, ...) = 0; + virtual void StartTrackPredictionErrors(CBasePlayer * pPlayer) = 0; + virtual void FinishTrackPredictionErrors(CBasePlayer * pPlayer) = 0; + virtual void DiffPrint(PRINTF_FORMAT_STRING char const *fmt, ...) = 0; // Allows other parts of the engine to find out the normal and ducked player // bbox sizes diff --git a/include/sdk/iinput.h b/include/sdk/iinput.h old mode 100755 new mode 100644 index 39bddee6..23e922c8 --- a/include/sdk/iinput.h +++ b/include/sdk/iinput.h @@ -37,10 +37,10 @@ public: virtual int GetButtonBits(int) = 0; // Create movement command virtual void CreateMove(int sequence_number, float input_sample_frametime, - bool active) = 0; - virtual void ExtraMouseSample(float frametime, bool active) = 0; + bool active) = 0; + virtual void ExtraMouseSample(float frametime, bool active) = 0; virtual bool WriteUsercmdDeltaToBuffer(bf_write *buf, int from, int to, - bool isnewcommand) = 0; + bool isnewcommand) = 0; virtual void EncodeUserCmdToBuffer(bf_write &buf, int slot) = 0; virtual void DecodeUserCmdFromBuffer(bf_read &buf, int slot) = 0; @@ -77,13 +77,13 @@ public: // Retrieve mouse position virtual void GetFullscreenMousePos(int *mx, int *my, int *unclampedx = 0, int *unclampedy = 0) = 0; - virtual void SetFullscreenMousePos(int mx, int my) = 0; - virtual void ResetMouse(void) = 0; - virtual float GetLastForwardMove(void) = 0; - virtual float Joystick_GetForward(void) = 0; - virtual float Joystick_GetSide(void) = 0; - virtual float Joystick_GetPitch(void) = 0; - virtual float Joystick_GetYaw(void) = 0; + virtual void SetFullscreenMousePos(int mx, int my) = 0; + virtual void ResetMouse(void) = 0; + virtual float GetLastForwardMove(void) = 0; + virtual float Joystick_GetForward(void) = 0; + virtual float Joystick_GetSide(void) = 0; + virtual float Joystick_GetPitch(void) = 0; + virtual float Joystick_GetYaw(void) = 0; // Third Person camera ( TODO/FIXME: Move this to a separate interface? ) virtual void CAM_Think(void) = 0; @@ -98,8 +98,8 @@ public: // orthographic camera info ( TODO/FIXME: Move this to a separate // interface? ) - virtual void CAM_ToOrthographic() = 0; - virtual bool CAM_IsOrthographic() const = 0; + virtual void CAM_ToOrthographic() = 0; + virtual bool CAM_IsOrthographic() const = 0; virtual void CAM_OrthographicSize(float &w, float &h) const = 0; #if defined(HL2_CLIENT_DLL) diff --git a/include/sdk/imaterialsystemfixed.h b/include/sdk/imaterialsystemfixed.h old mode 100755 new mode 100644 index b9a98f78..c3df66ec --- a/include/sdk/imaterialsystemfixed.h +++ b/include/sdk/imaterialsystemfixed.h @@ -167,7 +167,7 @@ public: // Get the image format of the back buffer. . useful when creating render // targets, etc. virtual void GetBackBufferDimensions(int &width, int &height) const = 0; - virtual ImageFormat GetBackBufferFormat() const = 0; + virtual ImageFormat GetBackBufferFormat() const = 0; virtual bool SupportsHDRMode(HDRType_t nHDRModede) = 0; @@ -186,8 +186,8 @@ public: // Control flow // ----------------------------------------------------------- - virtual void BeginFrame(float frameTime) = 0; - virtual void EndFrame() = 0; + virtual void BeginFrame(float frameTime) = 0; + virtual void EndFrame() = 0; virtual void Flush(bool flushHardware = false) = 0; /// FIXME: This stuff needs to be cleaned up and abstracted. @@ -226,7 +226,7 @@ public: // Used to iterate over all shaders for editing purposes // GetShaders returns the number of shaders it actually found - virtual int ShaderCount() const = 0; + virtual int ShaderCount() const = 0; virtual int GetShaders(int nFirstShader, int nMaxCount, IShader **ppShaderList) const = 0; @@ -470,15 +470,15 @@ public: virtual void ClearBuffers(bool bClearColor, bool bClearDepth, bool bClearStencil = false) = 0; -// ----------------------------------------------------------- -// X360 specifics -// ----------------------------------------------------------- + // ----------------------------------------------------------- + // X360 specifics + // ----------------------------------------------------------- #if defined(_X360) - virtual void ListUsedMaterials(void) = 0; + virtual void ListUsedMaterials(void) = 0; virtual HXUIFONT OpenTrueTypeFont(const char *pFontname, int tall, - int style) = 0; - virtual void CloseTrueTypeFont(HXUIFONT hFont) = 0; + int style) = 0; + virtual void CloseTrueTypeFont(HXUIFONT hFont) = 0; virtual bool GetTrueTypeFontMetrics(HXUIFONT hFont, XUIFontMetrics * pFontMetrics, XUICharMetrics charMetrics[256]) = 0; @@ -536,7 +536,7 @@ public: virtual ImageFormat GetNullTextureFormat() = 0; virtual void AddTextureAlias(const char *pAlias, const char *pRealName) = 0; - virtual void RemoveTextureAlias(const char *pAlias) = 0; + virtual void RemoveTextureAlias(const char *pAlias) = 0; // returns a lightmap page ID for this allocation, -1 if none available // frameID is a number that should be changed every frame to prevent locking @@ -553,7 +553,7 @@ public: // For sv_pure mode. The filesystem figures out which files the client needs // to reload to be "pure" ala the server's preferences. - virtual void ReloadFilesInList(IFileList * pFilesToReload) = 0; + virtual void ReloadFilesInList(IFileList * pFilesToReload) = 0; virtual bool AllowThreading(bool bAllow, int nServiceThread) = 0; // Extended version of FindMaterial(). diff --git a/include/sdk/netmessage.hpp b/include/sdk/netmessage.hpp old mode 100755 new mode 100644 index 44b2245d..9cb4bccb --- a/include/sdk/netmessage.hpp +++ b/include/sdk/netmessage.hpp @@ -181,7 +181,8 @@ protected: #define NETMSG_TYPE_BITS 5 typedef int QueryCvarCookie_t; -typedef enum { +typedef enum +{ eQueryCvarValueStatus_ValueIntact = 0, // It got the value fine. eQueryCvarValueStatus_CvarNotFound = 1, eQueryCvarValueStatus_NotACvar = diff --git a/include/settings/Bool.hpp b/include/settings/Bool.hpp old mode 100755 new mode 100644 index 18373538..67bf68c0 --- a/include/settings/Bool.hpp +++ b/include/settings/Bool.hpp @@ -78,4 +78,4 @@ protected: bool value{ false }; std::string string{ "false" }; }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Float.hpp b/include/settings/Float.hpp old mode 100755 new mode 100644 index d6d07af3..11e8089c --- a/include/settings/Float.hpp +++ b/include/settings/Float.hpp @@ -51,4 +51,4 @@ protected: string = str; } }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Int.hpp b/include/settings/Int.hpp old mode 100755 new mode 100644 index 11ada1d4..d564a9ad --- a/include/settings/Int.hpp +++ b/include/settings/Int.hpp @@ -43,4 +43,4 @@ public: return value != 0; } }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Key.hpp b/include/settings/Key.hpp old mode 100755 new mode 100644 index bcb3e0fc..eb1e749b --- a/include/settings/Key.hpp +++ b/include/settings/Key.hpp @@ -139,4 +139,4 @@ protected: std::string string{}; Key value{}; }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Manager.hpp b/include/settings/Manager.hpp old mode 100755 new mode 100644 index 8617b3b5..8928a167 --- a/include/settings/Manager.hpp +++ b/include/settings/Manager.hpp @@ -46,4 +46,4 @@ public: std::unordered_map registered{}; }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Registered.hpp b/include/settings/Registered.hpp old mode 100755 new mode 100644 index eb148971..427078ba --- a/include/settings/Registered.hpp +++ b/include/settings/Registered.hpp @@ -39,4 +39,4 @@ using Button = RegisteredVariableProxy; #if ENABLE_VISUALS using Rgba = RegisteredVariableProxy; #endif -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Rgba.hpp b/include/settings/Rgba.hpp old mode 100755 new mode 100644 index e38249c3..95a9c111 --- a/include/settings/Rgba.hpp +++ b/include/settings/Rgba.hpp @@ -87,4 +87,4 @@ protected: glez::rgba value{}; std::string string{ "00000000" }; }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/Settings.hpp b/include/settings/Settings.hpp old mode 100755 new mode 100644 index f1dd97ec..774ef87c --- a/include/settings/Settings.hpp +++ b/include/settings/Settings.hpp @@ -131,7 +131,7 @@ protected: string = std::to_string(value); } }; -} +} // namespace settings #include "Bool.hpp" #include "Float.hpp" diff --git a/include/settings/SettingsIO.hpp b/include/settings/SettingsIO.hpp old mode 100755 new mode 100644 index 3962cc3f..453a9e6e --- a/include/settings/SettingsIO.hpp +++ b/include/settings/SettingsIO.hpp @@ -52,4 +52,4 @@ protected: std::ofstream stream{}; Manager &manager; }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/settings/String.hpp b/include/settings/String.hpp old mode 100755 new mode 100644 index 6a6da440..004ca296 --- a/include/settings/String.hpp +++ b/include/settings/String.hpp @@ -49,4 +49,4 @@ public: protected: std::string value{}; }; -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/include/tfmm.hpp b/include/tfmm.hpp old mode 100755 new mode 100644 index 7bdcc3d3..fd7f252a --- a/include/tfmm.hpp +++ b/include/tfmm.hpp @@ -15,4 +15,4 @@ void leaveQueue(); void disconnectAndAbandon(); void abandon(); int getQueue(); -} +} // namespace tfmm diff --git a/include/trace.hpp b/include/trace.hpp old mode 100755 new mode 100644 index 8a0c5dc7..bc3f47b2 --- a/include/trace.hpp +++ b/include/trace.hpp @@ -60,4 +60,4 @@ public: extern FilterDefault filter_default; extern FilterNoPlayer filter_no_player; extern FilterPenetration filter_penetration; -} +} // namespace trace diff --git a/include/velocity.hpp b/include/velocity.hpp old mode 100755 new mode 100644 index 365c52f4..f10d8a80 --- a/include/velocity.hpp +++ b/include/velocity.hpp @@ -16,4 +16,4 @@ typedef std::function EstimateAbsVelocity_t; extern EstimateAbsVelocity_t EstimateAbsVelocity; void Init(); -} \ No newline at end of file +} // namespace velocity \ No newline at end of file diff --git a/include/visual/EffectChams.hpp b/include/visual/EffectChams.hpp old mode 100755 new mode 100644 index 2bfe231f..25aba678 --- a/include/visual/EffectChams.hpp +++ b/include/visual/EffectChams.hpp @@ -54,4 +54,4 @@ public: extern EffectChams g_EffectChams; extern CScreenSpaceEffectRegistration *g_pEffectChams; -} +} // namespace effect_chams diff --git a/include/visual/EffectGlow.hpp b/include/visual/EffectGlow.hpp old mode 100755 new mode 100644 index eec68346..f9bec227 --- a/include/visual/EffectGlow.hpp +++ b/include/visual/EffectGlow.hpp @@ -57,4 +57,4 @@ public: extern EffectGlow g_EffectGlow; extern CScreenSpaceEffectRegistration *g_pEffectGlow; -} +} // namespace effect_glow diff --git a/include/visual/SDLHooks.hpp b/include/visual/SDLHooks.hpp old mode 100755 new mode 100644 index 22ee4bda..18962afc --- a/include/visual/SDLHooks.hpp +++ b/include/visual/SDLHooks.hpp @@ -14,4 +14,4 @@ extern SDL_Window *window; void applySdlHooks(); void cleanSdlHooks(); -} \ No newline at end of file +} // namespace sdl_hooks \ No newline at end of file diff --git a/include/visual/atlas.hpp b/include/visual/atlas.hpp old mode 100755 new mode 100644 index 674b75f3..c7de94a0 --- a/include/visual/atlas.hpp +++ b/include/visual/atlas.hpp @@ -50,4 +50,4 @@ public: }; texture_atlas &atlas(); -} +} // namespace textures diff --git a/include/visual/colors.hpp b/include/visual/colors.hpp old mode 100755 new mode 100644 index ea947dd3..8d95028b --- a/include/visual/colors.hpp +++ b/include/visual/colors.hpp @@ -32,7 +32,7 @@ constexpr unsigned team(int team) return blu; return white; } -} +} // namespace chat struct rgba_t { @@ -162,6 +162,6 @@ constexpr rgba_t Health(int health, int max) } rgba_t RainbowCurrent(); rgba_t EntityF(CachedEntity *ent); -} +} // namespace colors using rgba_t = colors::rgba_t; diff --git a/include/visual/drawing.hpp b/include/visual/drawing.hpp old mode 100755 new mode 100644 index 94a06ad5..71b37cfd --- a/include/visual/drawing.hpp +++ b/include/visual/drawing.hpp @@ -21,7 +21,7 @@ namespace fonts extern std::unique_ptr esp; extern std::unique_ptr menu; -} +} // namespace fonts namespace fonts { @@ -35,7 +35,7 @@ void Update(); extern const std::vector fonts; extern CatEnum family_enum; -} +} // namespace fonts constexpr rgba_t GUIColor() { @@ -69,4 +69,4 @@ bool EntityCenterToScreen(CachedEntity *entity, Vector &out); void InitGL(); void BeginGL(); void EndGL(); -} +} // namespace draw diff --git a/include/visual/menu/GuiInterface.hpp b/include/visual/menu/GuiInterface.hpp old mode 100755 new mode 100644 index cfc2007a..ed64781c --- a/include/visual/menu/GuiInterface.hpp +++ b/include/visual/menu/GuiInterface.hpp @@ -14,4 +14,4 @@ void draw(); bool handleSdlEvent(SDL_Event *event); void onLevelLoad(); -} \ No newline at end of file +} // namespace gui \ No newline at end of file diff --git a/include/visual/menu/menu/BaseMenuObject.hpp b/include/visual/menu/menu/BaseMenuObject.hpp old mode 100755 new mode 100644 index 109026dc..f8bc23a6 --- a/include/visual/menu/menu/BaseMenuObject.hpp +++ b/include/visual/menu/menu/BaseMenuObject.hpp @@ -140,4 +140,4 @@ protected: static size_t object_sequence_number; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/BoundingBox.hpp b/include/visual/menu/menu/BoundingBox.hpp old mode 100755 new mode 100644 index 8875fbae..3b475e3b --- a/include/visual/menu/menu/BoundingBox.hpp +++ b/include/visual/menu/menu/BoundingBox.hpp @@ -175,4 +175,4 @@ public: BaseMenuObject &object; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/Debug.hpp b/include/visual/menu/menu/Debug.hpp old mode 100755 new mode 100644 index 2939217a..e8845e14 --- a/include/visual/menu/menu/Debug.hpp +++ b/include/visual/menu/menu/Debug.hpp @@ -16,4 +16,4 @@ public: int depth{ 0 }; }; -} \ No newline at end of file +} // namespace zerokernel::debug \ No newline at end of file diff --git a/include/visual/menu/menu/KeyValue.hpp b/include/visual/menu/menu/KeyValue.hpp old mode 100755 new mode 100644 index f10d1f00..e27471b8 --- a/include/visual/menu/menu/KeyValue.hpp +++ b/include/visual/menu/menu/KeyValue.hpp @@ -49,4 +49,4 @@ public: protected: std::unordered_map values{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/Menu.hpp b/include/visual/menu/menu/Menu.hpp old mode 100755 new mode 100644 index 9472404e..433bf8c2 --- a/include/visual/menu/menu/Menu.hpp +++ b/include/visual/menu/menu/Menu.hpp @@ -20,7 +20,7 @@ namespace resource::font { extern glez::font base; extern glez::font bold; -} +} // namespace resource::font namespace style::colors { @@ -29,7 +29,7 @@ using color_type = settings::RVariable; extern color_type text; extern color_type text_shadow; extern color_type error; -} +} // namespace style::colors class Menu : public IMessageHandler { @@ -89,4 +89,4 @@ public: tinyxml2::XMLDocument xml_source{}; std::unordered_map prefabs{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/Message.hpp b/include/visual/menu/menu/Message.hpp old mode 100755 new mode 100644 index 5b017b82..740c098c --- a/include/visual/menu/menu/Message.hpp +++ b/include/visual/menu/menu/Message.hpp @@ -21,4 +21,4 @@ public: KeyValue kv; BaseMenuObject *sender{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/ModalBehavior.hpp b/include/visual/menu/menu/ModalBehavior.hpp old mode 100755 new mode 100644 index 7da6e907..69ee5503 --- a/include/visual/menu/menu/ModalBehavior.hpp +++ b/include/visual/menu/menu/ModalBehavior.hpp @@ -25,4 +25,4 @@ public: BaseMenuObject *object; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/ObjectFactory.hpp b/include/visual/menu/menu/ObjectFactory.hpp old mode 100755 new mode 100644 index b9111218..fb340a2c --- a/include/visual/menu/menu/ObjectFactory.hpp +++ b/include/visual/menu/menu/ObjectFactory.hpp @@ -21,4 +21,4 @@ public: static std::unique_ptr createFromPrefab(const std::string &prefab_id); }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/StaticTextComponent.hpp b/include/visual/menu/menu/StaticTextComponent.hpp old mode 100755 new mode 100644 index 490ac605..d50a7bd1 --- a/include/visual/menu/menu/StaticTextComponent.hpp +++ b/include/visual/menu/menu/StaticTextComponent.hpp @@ -25,4 +25,4 @@ public: const std::string string; glez::font &font; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/TextComponent.hpp b/include/visual/menu/menu/TextComponent.hpp old mode 100755 new mode 100644 index 4e17099e..e7c36e5c --- a/include/visual/menu/menu/TextComponent.hpp +++ b/include/visual/menu/menu/TextComponent.hpp @@ -33,4 +33,4 @@ public: const glez::rgba &default_text; const glez::rgba &default_outline; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/Tooltip.hpp b/include/visual/menu/menu/Tooltip.hpp old mode 100755 new mode 100644 index 1ac7c053..135ce20d --- a/include/visual/menu/menu/Tooltip.hpp +++ b/include/visual/menu/menu/Tooltip.hpp @@ -28,4 +28,4 @@ public: std::string lastText; bool shown{ false }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/Utility.hpp b/include/visual/menu/menu/Utility.hpp old mode 100755 new mode 100644 index 40d078c8..d317e9c0 --- a/include/visual/menu/menu/Utility.hpp +++ b/include/visual/menu/menu/Utility.hpp @@ -32,4 +32,4 @@ template <> inline int mod(int first, int second) } extern const std::string empty_string; -} \ No newline at end of file +} // namespace utility \ No newline at end of file diff --git a/include/visual/menu/menu/interface/IMessageHandler.hpp b/include/visual/menu/menu/interface/IMessageHandler.hpp old mode 100755 new mode 100644 index e5101bd4..304eaeea --- a/include/visual/menu/menu/interface/IMessageHandler.hpp +++ b/include/visual/menu/menu/interface/IMessageHandler.hpp @@ -15,4 +15,4 @@ class IMessageHandler public: virtual void handleMessage(Message &msg, bool is_relayed) = 0; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/ModalSpinner.hpp b/include/visual/menu/menu/object/ModalSpinner.hpp old mode 100755 new mode 100644 index 8f244cd7..51e6c150 --- a/include/visual/menu/menu/object/ModalSpinner.hpp +++ b/include/visual/menu/menu/object/ModalSpinner.hpp @@ -43,4 +43,4 @@ public: ModalBehavior modal; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/Option.hpp b/include/visual/menu/menu/object/Option.hpp old mode 100755 new mode 100644 index e1be4911..1c1e5a72 --- a/include/visual/menu/menu/object/Option.hpp +++ b/include/visual/menu/menu/object/Option.hpp @@ -35,4 +35,4 @@ public: const std::string name; const std::string value; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/TabButton.hpp b/include/visual/menu/menu/object/TabButton.hpp old mode 100755 new mode 100644 index 5d8e6655..b272f7ae --- a/include/visual/menu/menu/object/TabButton.hpp +++ b/include/visual/menu/menu/object/TabButton.hpp @@ -36,4 +36,4 @@ protected: TabSelection &parent; const size_t id; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/Text.hpp b/include/visual/menu/menu/object/Text.hpp old mode 100755 new mode 100644 index 843bb542..1a03118c --- a/include/visual/menu/menu/object/Text.hpp +++ b/include/visual/menu/menu/object/Text.hpp @@ -72,4 +72,4 @@ public: protected: std::string data{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/Box.hpp b/include/visual/menu/menu/object/container/Box.hpp old mode 100755 new mode 100644 index e37c2134..e9ed368e --- a/include/visual/menu/menu/object/container/Box.hpp +++ b/include/visual/menu/menu/object/container/Box.hpp @@ -37,4 +37,4 @@ public: Text title{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/Container.hpp b/include/visual/menu/menu/object/container/Container.hpp old mode 100755 new mode 100644 index a473df43..ce5f2d11 --- a/include/visual/menu/menu/object/container/Container.hpp +++ b/include/visual/menu/menu/object/container/Container.hpp @@ -65,4 +65,4 @@ public: bool reorder_needed{ true }; std::vector> objects{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/LabeledObject.hpp b/include/visual/menu/menu/object/container/LabeledObject.hpp old mode 100755 new mode 100644 index 32adb8ff..32d18714 --- a/include/visual/menu/menu/object/container/LabeledObject.hpp +++ b/include/visual/menu/menu/object/container/LabeledObject.hpp @@ -33,4 +33,4 @@ public: Text *label{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/List.hpp b/include/visual/menu/menu/object/container/List.hpp old mode 100755 new mode 100644 index b32c60fe..ef5e8381 --- a/include/visual/menu/menu/object/container/List.hpp +++ b/include/visual/menu/menu/object/container/List.hpp @@ -23,4 +23,4 @@ public: int interval{ 3 }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/ModalColorSelect.hpp b/include/visual/menu/menu/object/container/ModalColorSelect.hpp old mode 100755 new mode 100644 index 3052e844..3146d67b --- a/include/visual/menu/menu/object/container/ModalColorSelect.hpp +++ b/include/visual/menu/menu/object/container/ModalColorSelect.hpp @@ -52,4 +52,4 @@ public: ModalBehavior modal; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/ModalContainer.hpp b/include/visual/menu/menu/object/container/ModalContainer.hpp old mode 100755 new mode 100644 index e9b67a6f..df83658f --- a/include/visual/menu/menu/object/container/ModalContainer.hpp +++ b/include/visual/menu/menu/object/container/ModalContainer.hpp @@ -23,4 +23,4 @@ public: ModalBehavior modal; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/ModalSelect.hpp b/include/visual/menu/menu/object/container/ModalSelect.hpp old mode 100755 new mode 100644 index 4bbc9190..d8558a19 --- a/include/visual/menu/menu/object/container/ModalSelect.hpp +++ b/include/visual/menu/menu/object/container/ModalSelect.hpp @@ -28,4 +28,4 @@ public: void addOption(std::string name, std::string value, std::optional tooltip); }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/ScrollableList.hpp b/include/visual/menu/menu/object/container/ScrollableList.hpp old mode 100755 new mode 100644 index 98bdc0b6..06058670 --- a/include/visual/menu/menu/object/container/ScrollableList.hpp +++ b/include/visual/menu/menu/object/container/ScrollableList.hpp @@ -39,4 +39,4 @@ public: size_t start_index{ 0 }; size_t end_index{ 0 }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/SmartContentContainer.hpp b/include/visual/menu/menu/object/container/SmartContentContainer.hpp old mode 100755 new mode 100644 index 3899a26f..30365169 --- a/include/visual/menu/menu/object/container/SmartContentContainer.hpp +++ b/include/visual/menu/menu/object/container/SmartContentContainer.hpp @@ -53,4 +53,4 @@ public: Direction direction{ Direction::HORIZONTAL }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/TData.hpp b/include/visual/menu/menu/object/container/TData.hpp old mode 100755 new mode 100644 index a4fda5f3..f30fcb9e --- a/include/visual/menu/menu/object/container/TData.hpp +++ b/include/visual/menu/menu/object/container/TData.hpp @@ -23,4 +23,4 @@ public: TRow *row; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/TRow.hpp b/include/visual/menu/menu/object/container/TRow.hpp old mode 100755 new mode 100644 index a0609ca4..67a9dcfe --- a/include/visual/menu/menu/object/container/TRow.hpp +++ b/include/visual/menu/menu/object/container/TRow.hpp @@ -26,4 +26,4 @@ public: Table *table; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/TabContainer.hpp b/include/visual/menu/menu/object/container/TabContainer.hpp old mode 100755 new mode 100644 index 7feb6cc1..4dd98956 --- a/include/visual/menu/menu/object/container/TabContainer.hpp +++ b/include/visual/menu/menu/object/container/TabContainer.hpp @@ -52,4 +52,4 @@ public: TabSelection selection; std::vector> containers{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/TabSelection.hpp b/include/visual/menu/menu/object/container/TabSelection.hpp old mode 100755 new mode 100644 index 498d3fad..ae3763ca --- a/include/visual/menu/menu/object/container/TabSelection.hpp +++ b/include/visual/menu/menu/object/container/TabSelection.hpp @@ -36,4 +36,4 @@ public: int offset{ 0 }; size_t active{ 0 }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/container/Table.hpp b/include/visual/menu/menu/object/container/Table.hpp old mode 100755 new mode 100644 index 5d3ed6aa..6974787d --- a/include/visual/menu/menu/object/container/Table.hpp +++ b/include/visual/menu/menu/object/container/Table.hpp @@ -40,4 +40,4 @@ public: std::vector columns{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/Checkbox.hpp b/include/visual/menu/menu/object/input/Checkbox.hpp old mode 100755 new mode 100644 index 3a3adff2..808fd0e5 --- a/include/visual/menu/menu/object/input/Checkbox.hpp +++ b/include/visual/menu/menu/object/input/Checkbox.hpp @@ -34,4 +34,4 @@ public: protected: settings::Variable *option{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/ColorSelector.hpp b/include/visual/menu/menu/object/input/ColorSelector.hpp old mode 100755 new mode 100644 index 69d689b7..f6c86dc0 --- a/include/visual/menu/menu/object/input/ColorSelector.hpp +++ b/include/visual/menu/menu/object/input/ColorSelector.hpp @@ -28,4 +28,4 @@ public: protected: settings::Variable *variable{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/InputKey.hpp b/include/visual/menu/menu/object/input/InputKey.hpp old mode 100755 new mode 100644 index eaf7968a..0dc78674 --- a/include/visual/menu/menu/object/input/InputKey.hpp +++ b/include/visual/menu/menu/object/input/InputKey.hpp @@ -34,4 +34,4 @@ public: settings::Variable *key{}; bool capturing{ false }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/Select.hpp b/include/visual/menu/menu/object/input/Select.hpp old mode 100755 new mode 100644 index 0e9870fe..949c1201 --- a/include/visual/menu/menu/object/input/Select.hpp +++ b/include/visual/menu/menu/object/input/Select.hpp @@ -55,4 +55,4 @@ public: protected: }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/Slider.hpp b/include/visual/menu/menu/object/input/Slider.hpp old mode 100755 new mode 100644 index 14269810..57cd8ab1 --- a/include/visual/menu/menu/object/input/Slider.hpp +++ b/include/visual/menu/menu/object/input/Slider.hpp @@ -126,22 +126,20 @@ public: } } - if - constexpr(std::is_same::value) - { - data->QueryIntAttribute("min", &min); - data->QueryIntAttribute("max", &max); - data->QueryIntAttribute("step", &step); - option = dynamic_cast *>(opt); - } - else if - constexpr(std::is_same::value) - { - data->QueryFloatAttribute("min", &min); - data->QueryFloatAttribute("max", &max); - data->QueryFloatAttribute("step", &step); - option = dynamic_cast *>(opt); - } + if constexpr (std::is_same::value) + { + data->QueryIntAttribute("min", &min); + data->QueryIntAttribute("max", &max); + data->QueryIntAttribute("step", &step); + option = dynamic_cast *>(opt); + } + else if constexpr (std::is_same::value) + { + data->QueryFloatAttribute("min", &min); + data->QueryFloatAttribute("max", &max); + data->QueryFloatAttribute("step", &step); + option = dynamic_cast *>(opt); + } } void update() override @@ -242,4 +240,4 @@ public: settings::ArithmeticVariable *option{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/Spinner.hpp b/include/visual/menu/menu/object/input/Spinner.hpp old mode 100755 new mode 100644 index fe547344..b7c0adf8 --- a/include/visual/menu/menu/object/input/Spinner.hpp +++ b/include/visual/menu/menu/object/input/Spinner.hpp @@ -74,18 +74,16 @@ public: } } - if - constexpr(std::is_same::value) - { - data->QueryIntAttribute("step", &step); - option = dynamic_cast *>(opt); - } - else if - constexpr(std::is_same::value) - { - data->QueryFloatAttribute("step", &step); - option = dynamic_cast *>(opt); - } + if constexpr (std::is_same::value) + { + data->QueryIntAttribute("step", &step); + option = dynamic_cast *>(opt); + } + else if constexpr (std::is_same::value) + { + data->QueryFloatAttribute("step", &step); + option = dynamic_cast *>(opt); + } } const std::string &getValue() override @@ -113,4 +111,4 @@ public: settings::ArithmeticVariable *option{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/StringInput.hpp b/include/visual/menu/menu/object/input/StringInput.hpp old mode 100755 new mode 100644 index ec4e70d8..55b007fc --- a/include/visual/menu/menu/object/input/StringInput.hpp +++ b/include/visual/menu/menu/object/input/StringInput.hpp @@ -30,4 +30,4 @@ public: protected: settings::IVariable *option{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/object/input/TextInput.hpp b/include/visual/menu/menu/object/input/TextInput.hpp old mode 100755 new mode 100644 index f48a882e..c1d19110 --- a/include/visual/menu/menu/object/input/TextInput.hpp +++ b/include/visual/menu/menu/object/input/TextInput.hpp @@ -49,4 +49,4 @@ public: std::string current_text{}; std::string text{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/special/ModalFactory.hpp b/include/visual/menu/menu/special/ModalFactory.hpp old mode 100755 new mode 100644 index cf022c14..440498f4 --- a/include/visual/menu/menu/special/ModalFactory.hpp +++ b/include/visual/menu/menu/special/ModalFactory.hpp @@ -10,4 +10,4 @@ namespace zerokernel::special class ModalFactory { }; -} \ No newline at end of file +} // namespace zerokernel::special \ No newline at end of file diff --git a/include/visual/menu/menu/special/PlayerListController.hpp b/include/visual/menu/menu/special/PlayerListController.hpp old mode 100755 new mode 100644 index 9bbb8b6d..ba14b27f --- a/include/visual/menu/menu/special/PlayerListController.hpp +++ b/include/visual/menu/menu/special/PlayerListController.hpp @@ -69,4 +69,4 @@ public: kick_callback_type cb_kick; open_steam_callback_type cb_open_steam; }; -} \ No newline at end of file +} // namespace zerokernel::special \ No newline at end of file diff --git a/include/visual/menu/menu/special/SettingsManagerList.hpp b/include/visual/menu/menu/special/SettingsManagerList.hpp old mode 100755 new mode 100644 index 904d9b33..e1277ffb --- a/include/visual/menu/menu/special/SettingsManagerList.hpp +++ b/include/visual/menu/menu/special/SettingsManagerList.hpp @@ -51,4 +51,4 @@ public: TreeNode root{}; Container &list; }; -} \ No newline at end of file +} // namespace zerokernel::special \ No newline at end of file diff --git a/include/visual/menu/menu/special/TreeListBaseEntry.hpp b/include/visual/menu/menu/special/TreeListBaseEntry.hpp old mode 100755 new mode 100644 index 699a2515..e8acb0e9 --- a/include/visual/menu/menu/special/TreeListBaseEntry.hpp +++ b/include/visual/menu/menu/special/TreeListBaseEntry.hpp @@ -34,4 +34,4 @@ public: size_t depth{ 0 }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/special/TreeListCollapsible.hpp b/include/visual/menu/menu/special/TreeListCollapsible.hpp old mode 100755 new mode 100644 index 6be7efa7..1132bc4f --- a/include/visual/menu/menu/special/TreeListCollapsible.hpp +++ b/include/visual/menu/menu/special/TreeListCollapsible.hpp @@ -46,4 +46,4 @@ public: Text text{}; std::string name{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/special/VariableListEntry.hpp b/include/visual/menu/menu/special/VariableListEntry.hpp old mode 100755 new mode 100644 index 0dde40b5..687bf4f3 --- a/include/visual/menu/menu/special/VariableListEntry.hpp +++ b/include/visual/menu/menu/special/VariableListEntry.hpp @@ -62,4 +62,4 @@ public: std::unique_ptr control{ nullptr }; Text label{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/tinyxml2.hpp b/include/visual/menu/menu/tinyxml2.hpp old mode 100755 new mode 100644 index cab24ac0..13d6786e --- a/include/visual/menu/menu/tinyxml2.hpp +++ b/include/visual/menu/menu/tinyxml2.hpp @@ -1980,7 +1980,7 @@ public: return _writeBOM; } /** Sets whether to write the BOM when writing the file. - */ + */ void SetBOM(bool useBOM) { _writeBOM = useBOM; @@ -2610,7 +2610,7 @@ private: XMLPrinter &operator=(const XMLPrinter &); }; -} // tinyxml2 +} // namespace tinyxml2 #if defined(_MSC_VER) #pragma warning(pop) diff --git a/include/visual/menu/menu/wm/Task.hpp b/include/visual/menu/menu/wm/Task.hpp old mode 100755 new mode 100644 index 91298391..60fa08b8 --- a/include/visual/menu/menu/wm/Task.hpp +++ b/include/visual/menu/menu/wm/Task.hpp @@ -42,4 +42,4 @@ public: WMWindow &window; Text text{}; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/wm/TaskBar.hpp b/include/visual/menu/menu/wm/TaskBar.hpp old mode 100755 new mode 100644 index ac10e321..af09f0d2 --- a/include/visual/menu/menu/wm/TaskBar.hpp +++ b/include/visual/menu/menu/wm/TaskBar.hpp @@ -39,4 +39,4 @@ public: WindowManager &wm; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/wm/WMWindow.hpp b/include/visual/menu/menu/wm/WMWindow.hpp old mode 100755 new mode 100644 index 0e5ebdd5..6b595e81 --- a/include/visual/menu/menu/wm/WMWindow.hpp +++ b/include/visual/menu/menu/wm/WMWindow.hpp @@ -75,4 +75,4 @@ public: WindowHeader *header{ nullptr }; Container *contents{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/wm/WindowCloseButton.hpp b/include/visual/menu/menu/wm/WindowCloseButton.hpp old mode 100755 new mode 100644 index 9040793f..b07e4e90 --- a/include/visual/menu/menu/wm/WindowCloseButton.hpp +++ b/include/visual/menu/menu/wm/WindowCloseButton.hpp @@ -22,4 +22,4 @@ public: bool onLeftMouseClick() override; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/wm/WindowContainer.hpp b/include/visual/menu/menu/wm/WindowContainer.hpp old mode 100755 new mode 100644 index 2d335677..0c7531ea --- a/include/visual/menu/menu/wm/WindowContainer.hpp +++ b/include/visual/menu/menu/wm/WindowContainer.hpp @@ -65,4 +65,4 @@ public: WindowManager &wm; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/wm/WindowHeader.hpp b/include/visual/menu/menu/wm/WindowHeader.hpp old mode 100755 new mode 100644 index 9e204fa7..ce745879 --- a/include/visual/menu/menu/wm/WindowHeader.hpp +++ b/include/visual/menu/menu/wm/WindowHeader.hpp @@ -48,4 +48,4 @@ public: WindowCloseButton *close{ nullptr }; Text *title{ nullptr }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/include/visual/menu/menu/wm/WindowManager.hpp b/include/visual/menu/menu/wm/WindowManager.hpp old mode 100755 new mode 100644 index 1f8c95f2..d7f676ab --- a/include/visual/menu/menu/wm/WindowManager.hpp +++ b/include/visual/menu/menu/wm/WindowManager.hpp @@ -36,4 +36,4 @@ public: size_t active_window{ 0 }; }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/PlayerTools.cpp b/src/PlayerTools.cpp old mode 100755 new mode 100644 index 8fc18136..ccbf994c --- a/src/PlayerTools.cpp +++ b/src/PlayerTools.cpp @@ -158,4 +158,4 @@ void onKilledBy(CachedEntity *entity) { onKilledBy(entity->player_info.friendsID); } -} \ No newline at end of file +} // namespace player_tools \ No newline at end of file diff --git a/src/angles.cpp b/src/angles.cpp old mode 100755 new mode 100644 index e79f5704..51453216 --- a/src/angles.cpp +++ b/src/angles.cpp @@ -39,4 +39,4 @@ void Update() } } } -} +} // namespace angles diff --git a/src/backpacktf.cpp b/src/backpacktf.cpp old mode 100755 new mode 100644 index 9af7b826..5b33d6e7 --- a/src/backpacktf.cpp +++ b/src/backpacktf.cpp @@ -236,4 +236,4 @@ void init() { GetBackpackTFThread(); } -} +} // namespace backpacktf diff --git a/src/chatlog.cpp b/src/chatlog.cpp old mode 100755 new mode 100644 index 83ffd623..cd958c52 --- a/src/chatlog.cpp +++ b/src/chatlog.cpp @@ -115,9 +115,8 @@ void LogMessage(int eid, std::string message) player_info_s info{}; if (not g_IEngine->GetPlayerInfo(eid, &info)) return; - if (no_ipc && - playerlist::AccessData(info.friendsID).state == - playerlist::k_EState::IPC) + if (no_ipc && playerlist::AccessData(info.friendsID).state == + playerlist::k_EState::IPC) return; std::string name(info.name); @@ -138,4 +137,4 @@ void LogMessage(int eid, std::string message) #endif << csv_stream::end; } -} +} // namespace chatlog diff --git a/src/chatstack.cpp b/src/chatstack.cpp old mode 100755 new mode 100644 index 6d902fa6..89fdbe47 --- a/src/chatstack.cpp +++ b/src/chatstack.cpp @@ -48,4 +48,4 @@ void Reset() std::stack stack; float last_say = 0.0f; -} +} // namespace chat_stack diff --git a/src/classinfo/dynamic.gen.cpp b/src/classinfo/dynamic.gen.cpp old mode 100755 new mode 100644 index a8f43dd4..6a50bf18 --- a/src/classinfo/dynamic.gen.cpp +++ b/src/classinfo/dynamic.gen.cpp @@ -570,9 +570,9 @@ void dynamic::Populate() std::string name(cc->GetName()); if (classid_mapping.find(name) != classid_mapping.end()) *classid_mapping[name] = cc->m_ClassID; - cc = cc->m_pNext; + cc = cc->m_pNext; } } dynamic dynamic_list; -} \ No newline at end of file +} // namespace client_classes \ No newline at end of file diff --git a/src/conditions.cpp b/src/conditions.cpp old mode 100755 new mode 100644 index 110c7aaf..34ad3f2d --- a/src/conditions.cpp +++ b/src/conditions.cpp @@ -12,7 +12,7 @@ static CatCommand dump_conditions( [](const CCommand &args) { int id = atoi(args.Arg(1)); if (!id) - id = LOCAL_E->m_IDX; + id = LOCAL_E->m_IDX; CachedEntity *ent = ENTITY(id); if (CE_BAD(ent)) return; diff --git a/src/core/interfaces.cpp b/src/core/interfaces.cpp old mode 100755 new mode 100644 index ece03268..23a3f650 --- a/src/core/interfaces.cpp +++ b/src/core/interfaces.cpp @@ -83,8 +83,8 @@ void CreateInterfaces() g_ICvar = BruteforceInterface("VEngineCvar", sharedobj::vstdlib()); g_IEngine = BruteforceInterface("VEngineClient", sharedobj::engine()); - g_AppID = g_IEngine->GetAppID(); - g_IEntityList = BruteforceInterface("VClientEntityList", + g_AppID = g_IEngine->GetAppID(); + g_IEntityList = BruteforceInterface("VClientEntityList", sharedobj::client()); g_ISteamClient = BruteforceInterface( "SteamClient", sharedobj::steamclient(), 17); @@ -94,7 +94,7 @@ void CreateInterfaces() "GAMEEVENTSMANAGER", sharedobj::engine(), 1); g_IBaseClient = BruteforceInterface("VClient", sharedobj::client()); - g_ITrace = BruteforceInterface("EngineTraceClient", + g_ITrace = BruteforceInterface("EngineTraceClient", sharedobj::engine()); g_IInputSystem = BruteforceInterface( "InputSystemVersion", sharedobj::inputsystem()); @@ -122,7 +122,7 @@ void CreateInterfaces() g_ISteamFriends = g_ISteamClient->GetISteamFriends(su, sp, "SteamFriends002"); } - g_GlobalVars = **(reinterpret_cast( + g_GlobalVars = **(reinterpret_cast( (uintptr_t) 11 + gSignatures.GetClientSignature( "55 89 E5 83 EC ? 8B 45 08 8B 15 ? ? ? ? F3 0F 10"))); @@ -141,18 +141,16 @@ void CreateInterfaces() IF_GAME(IsTF2()) { g_IInput = **(reinterpret_cast( - (uintptr_t) 1 + - gSignatures.GetClientSignature( - "A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF " - "92 B4 00 00 00 A1 ? ? ? ? 8B 10"))); + (uintptr_t) 1 + gSignatures.GetClientSignature( + "A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF " + "92 B4 00 00 00 A1 ? ? ? ? 8B 10"))); } else IF_GAME(IsTF2C()) { g_IInput = **(reinterpret_cast( - (uintptr_t) 1 + - gSignatures.GetClientSignature( - "A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF " - "92 A8 00 00 00 A1 ? ? ? ? 8B 10"))); + (uintptr_t) 1 + gSignatures.GetClientSignature( + "A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF " + "92 A8 00 00 00 A1 ? ? ? ? 8B 10"))); } else { @@ -211,7 +209,7 @@ void CreateInterfaces() "VGUI_Surface", sharedobj::vguimatsurface()); g_IStudioRender = BruteforceInterface( "VStudioRender", sharedobj::studiorender()); - g_IVRenderView = BruteforceInterface("VEngineRenderView", + g_IVRenderView = BruteforceInterface("VEngineRenderView", sharedobj::engine()); g_IMaterialSystemHL = (IMaterialSystem *) g_IMaterialSystem; IF_GAME(IsTF2()) diff --git a/src/core/netvars.cpp b/src/core/netvars.cpp old mode 100755 new mode 100644 index e6bccad5..9ac29553 --- a/src/core/netvars.cpp +++ b/src/core/netvars.cpp @@ -32,9 +32,9 @@ void NetVars::Init() "DT_LocalWeaponData", "localdata", "m_iPrimaryAmmoType"); this->m_iSecondaryAmmoType = gNetvars.get_offset( "DT_LocalWeaponData", "localdata", "m_iSecondaryAmmoType"); - this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon", + this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon", "LocalWeaponData", "m_iClip1"); - this->m_iClip2 = gNetvars.get_offset("DT_BaseCombatWeapon", + this->m_iClip2 = gNetvars.get_offset("DT_BaseCombatWeapon", "LocalWeaponData", "m_iClip2"); this->m_Collision = gNetvars.get_offset("DT_BaseEntity", "m_Collision"); m_flSimulationTime = @@ -171,7 +171,7 @@ void NetVars::Init() "DT_BaseCombatWeapon", "LocalActiveWeaponData", "m_nNextThinkTick"); this->nTickBase = gNetvars.get_offset("DT_BasePlayer", "localdata", "m_nTickBase"); - this->vecPunchAngle = gNetvars.get_offset("DT_BasePlayer", "localdata", + this->vecPunchAngle = gNetvars.get_offset("DT_BasePlayer", "localdata", "m_Local", "m_vecPunchAngle"); this->vecPunchAngleVel = gNetvars.get_offset( "DT_BasePlayer", "localdata", "m_Local", "m_vecPunchAngleVel"); diff --git a/src/core/sharedobj.cpp b/src/core/sharedobj.cpp old mode 100755 new mode 100644 index dc3f87bc..78ca83c1 --- a/src/core/sharedobj.cpp +++ b/src/core/sharedobj.cpp @@ -169,4 +169,4 @@ SharedObject &libsdl() return obj; } #endif -} +} // namespace sharedobj diff --git a/src/crits.cpp b/src/crits.cpp old mode 100755 new mode 100644 index 555e96cd..cfafa422 --- a/src/crits.cpp +++ b/src/crits.cpp @@ -162,7 +162,7 @@ void create_move() if (CE_BAD(LOCAL_W)) return; if (current_user_cmd->command_number) - lastusercmd = current_user_cmd->command_number; + lastusercmd = current_user_cmd->command_number; IClientEntity *weapon = RAW_ENT(LOCAL_W); if (!re::C_TFWeaponBase::IsBaseCombatWeapon(weapon)) return; @@ -246,7 +246,7 @@ void draw() } } #endif -} +} // namespace criticals void crithack_saved_state::Load(IClientEntity *entity) { diff --git a/src/entitycache.cpp b/src/entitycache.cpp old mode 100755 new mode 100644 index bbcf4351..249edaa4 --- a/src/entitycache.cpp +++ b/src/entitycache.cpp @@ -159,4 +159,4 @@ void Invalidate() } int max = 0; -} +} // namespace entity_cache diff --git a/src/entityhitboxcache.cpp b/src/entityhitboxcache.cpp old mode 100755 new mode 100644 index 18df915e..9749c41d --- a/src/entityhitboxcache.cpp +++ b/src/entityhitboxcache.cpp @@ -80,7 +80,7 @@ void EntityHitboxCache::Init() } if (m_nNumHitboxes > CACHE_MAX_HITBOXES) m_nNumHitboxes = CACHE_MAX_HITBOXES; - m_bModelSet = true; + m_bModelSet = true; } m_bSuccess = true; } @@ -197,4 +197,4 @@ void Update() void Invalidate() { } -} +} // namespace hitbox_cache diff --git a/src/hack.cpp b/src/hack.cpp old mode 100755 new mode 100644 index 0aff59dc..b683a3a5 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -1,4 +1,4 @@ - /* +/* * hack.cpp * * Created on: Oct 3, 2016 diff --git a/src/hacks/Achievement.cpp b/src/hacks/Achievement.cpp old mode 100755 new mode 100644 index 6eefa891..2033654d --- a/src/hacks/Achievement.cpp +++ b/src/hacks/Achievement.cpp @@ -112,4 +112,4 @@ CatCommand lock_single( }); CatCommand lock("achievement_lock", "Lock all achievements", Lock); CatCommand unlock("achievement_unlock", "Unlock all achievements", Unlock); -} +} // namespace hacks::tf2::achievement diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp old mode 100755 new mode 100644 index 3c1639e3..3ef38f69 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -107,7 +107,7 @@ void CreateMove() if (auto_unzoom) { if (g_pLocalPlayer->holding_sniper_rifle && g_pLocalPlayer->bZoomed && - zoomTime.check(3000)) + zoomTime.test_and_set(3000)) { current_user_cmd->buttons |= IN_ATTACK2; } @@ -152,12 +152,16 @@ void CreateMove() { zoomTime.update(); if (not g_pLocalPlayer->bZoomed) - { current_user_cmd->buttons |= IN_ATTACK2; - } } } } + // If zoomed only is on, check if zoomed + if (zoomed_only && g_pLocalPlayer->holding_sniper_rifle) + { + if (!g_pLocalPlayer->bZoomed && !(current_user_cmd->buttons & IN_ATTACK)) + return; + } if (!g_IEntityList->GetClientEntity(target_entity->m_IDX)) return; @@ -265,13 +269,6 @@ bool ShouldAim() // Deadringer out? if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bFeignDeathReady)) return false; - // If zoomed only is on, check if zoomed - if (zoomed_only && g_pLocalPlayer->holding_sniper_rifle) - { - if (!g_pLocalPlayer->bZoomed && - !(current_user_cmd->buttons & IN_ATTACK)) - return false; - } // Is taunting? if (HasCondition(g_pLocalPlayer->entity)) return false; @@ -380,9 +377,9 @@ CachedEntity *RetrieveBestTarget(bool aimkey_state) if (GetWeaponMode() == weaponmode::weapon_melee || (int) priority_mode == 2) { - scr = 4096.0f - - calculated_data_array[i].aim_position.DistTo( - g_pLocalPlayer->v_Eye); + scr = + 4096.0f - calculated_data_array[i].aim_position.DistTo( + g_pLocalPlayer->v_Eye); } else { @@ -471,11 +468,13 @@ bool IsTargetStateGood(CachedEntity *entity) // Wait for charge if (wait_for_charge && g_pLocalPlayer->holding_sniper_rifle) { - float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 3; + float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 3; float maxhs = 450.0f; - if (CE_INT(LOCAL_W, netvar.iItemDefinitionIndex) == 230 || HasCondition(entity)) + if (CE_INT(LOCAL_W, netvar.iItemDefinitionIndex) == 230 || + HasCondition(entity)) { - cdmg = int(CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 1.35f); + cdmg = + int(CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 1.35f); maxhs = 203.0f; } bool maxCharge = cdmg >= maxhs; @@ -605,7 +604,7 @@ bool IsTargetStateGood(CachedEntity *entity) // Vis and fov checks if (!VischeckPredictedEntity(entity)) return false; - if (*fov > 0.0f && cd.fov > *fov) + if (*fov > 0.0f && cd.fov > *fov) return false; return true; @@ -833,7 +832,7 @@ void DoAutoshoot() } else begansticky = 0; - bool attack = true; + bool attack = true; // Rifle check IF_GAME(IsTF()) @@ -936,8 +935,7 @@ const Vector &PredictEntity(CachedEntity *entity) if ((entity->m_Type() == ENTITY_PLAYER)) { auto hb = hacks::shared::backtrack::headPositions - [entity->m_IDX] - [hacks::shared::backtrack::BestTick]; + [entity->m_IDX][hacks::shared::backtrack::BestTick]; cd.predict_tick = tickcount; result = hb.hitboxes[cd.hitbox].center; cd.fov = GetFov(g_pLocalPlayer->v_OrigViewangles, diff --git a/src/hacks/Announcer.cpp b/src/hacks/Announcer.cpp old mode 100755 new mode 100644 index 64e1efce..0e76c420 --- a/src/hacks/Announcer.cpp +++ b/src/hacks/Announcer.cpp @@ -177,4 +177,4 @@ void shutdown() { g_IEventManager2->RemoveListener(&listener()); } -} +} // namespace hacks::shared::announcer diff --git a/src/hacks/AntiAim.cpp b/src/hacks/AntiAim.cpp old mode 100755 new mode 100644 index 564cc6d0..2cadeec9 --- a/src/hacks/AntiAim.cpp +++ b/src/hacks/AntiAim.cpp @@ -338,7 +338,7 @@ float useEdge(float edgeViewAngle) edgeYaw = (float) -90; if (edgeToEdgeOn == 2) edgeYaw = (float) 90; - edgeTest = false; + edgeTest = false; } if ((edgeViewAngle >= -135) && (edgeViewAngle < -45) && edgeTest == true) { @@ -346,7 +346,7 @@ float useEdge(float edgeViewAngle) edgeYaw = (float) 0; if (edgeToEdgeOn == 2) edgeYaw = (float) 179; - edgeTest = false; + edgeTest = false; } if ((edgeViewAngle >= -45) && (edgeViewAngle < 45) && edgeTest == true) { @@ -354,7 +354,7 @@ float useEdge(float edgeViewAngle) edgeYaw = (float) 90; if (edgeToEdgeOn == 2) edgeYaw = (float) -90; - edgeTest = false; + edgeTest = false; } if ((edgeViewAngle <= 135) && (edgeViewAngle >= 45) && edgeTest == true) { @@ -362,7 +362,7 @@ float useEdge(float edgeViewAngle) edgeYaw = (float) 179; if (edgeToEdgeOn == 2) edgeYaw = (float) 0; - edgeTest = false; + edgeTest = false; } // return with the angle choosen return edgeYaw; @@ -613,4 +613,4 @@ bool isEnabled() { return *enable; } -} +} // namespace hacks::shared::antiaim diff --git a/src/hacks/AntiBackstab.cpp b/src/hacks/AntiBackstab.cpp old mode 100755 new mode 100644 index bbf075fa..c4d7ed9b --- a/src/hacks/AntiBackstab.cpp +++ b/src/hacks/AntiBackstab.cpp @@ -40,7 +40,7 @@ float GetAngle(CachedEntity *spy) diff = (A - B); yaw2 = acos(diff.x / diff.Length()) * 180.0f / PI; if (diff.y < 0) - yaw2 = -yaw2; + yaw2 = -yaw2; anglediff = yaw - yaw2; if (anglediff > 180) anglediff -= 360; @@ -113,4 +113,4 @@ void CreateMove() noaa = false; } } -} +} // namespace hacks::tf2::antibackstab diff --git a/src/hacks/AntiCheat.cpp b/src/hacks/AntiCheat.cpp old mode 100755 new mode 100644 index b1339752..3830cb10 --- a/src/hacks/AntiCheat.cpp +++ b/src/hacks/AntiCheat.cpp @@ -118,4 +118,4 @@ void Init() // FIXME free listener g_IGameEventManager->AddListener(&listener, false); } -} +} // namespace hacks::shared::anticheat diff --git a/src/hacks/AntiDisguise.cpp b/src/hacks/AntiDisguise.cpp old mode 100755 new mode 100644 index da974871..713d6f2f --- a/src/hacks/AntiDisguise.cpp +++ b/src/hacks/AntiDisguise.cpp @@ -48,4 +48,4 @@ void Draw() } } } -} +} // namespace hacks::tf2::antidisguise diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp old mode 100755 new mode 100644 index 7afed9ec..77fd4b53 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -67,7 +67,8 @@ bool unifiedCanBackstab(Vector &vecAngle, Vector min, Vector max, // Get melee range float meleeRange = re::C_TFWeaponBaseMelee::GetSwingRange(RAW_ENT(LOCAL_W)); if (fabsf(vecAngle.y - - NET_VECTOR(RAW_ENT(besttarget), netvar.m_angEyeAngles).y) >= 60.0f) + NET_VECTOR(RAW_ENT(besttarget), netvar.m_angEyeAngles).y) >= + 60.0f) return false; if (!min.x && !max.x) return false; diff --git a/src/hacks/AutoDeadringer.cpp b/src/hacks/AutoDeadringer.cpp old mode 100755 new mode 100644 index 1e198649..4e58ec31 --- a/src/hacks/AutoDeadringer.cpp +++ b/src/hacks/AutoDeadringer.cpp @@ -77,4 +77,4 @@ void CreateMove() current_user_cmd->buttons |= IN_ATTACK2; } } -} +} // namespace hacks::shared::deadringer diff --git a/src/hacks/AutoDetonator.cpp b/src/hacks/AutoDetonator.cpp old mode 100755 new mode 100644 index b8f4addf..4aed52ea --- a/src/hacks/AutoDetonator.cpp +++ b/src/hacks/AutoDetonator.cpp @@ -130,4 +130,4 @@ void CreateMove() // End of function, just return return; } -} +} // namespace hacks::tf::autodetonator diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp old mode 100755 new mode 100644 index fe66023d..9e7bcc8b --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -131,9 +131,8 @@ int FireDangerValue(CachedEntity *patient) return 2; IClientEntity *pyro_weapon = g_IEntityList->GetClientEntity( CE_INT(ent, netvar.hActiveWeapon) & 0xFFF); - return (pyro_weapon && - pyro_weapon->GetClientClass()->m_ClassID == - CL_CLASS(CTFFlameThrower)) + return (pyro_weapon && pyro_weapon->GetClientClass()->m_ClassID == + CL_CLASS(CTFFlameThrower)) ? 2 : 0; } @@ -172,7 +171,7 @@ int BlastDangerValue(CachedEntity *patient) { if (ent->m_bCritProjectile()) hasCritRockets = true; - hasRockets = true; + hasRockets = true; } it++; } @@ -453,7 +452,7 @@ void CreateMove() m_iNewTarget++; else m_iNewTarget = 0; - bool new_target = (old_target != m_iCurrentHealingTarget); + bool new_target = (old_target != m_iCurrentHealingTarget); if (new_target) { m_iNewTarget = 1; @@ -518,7 +517,7 @@ void UpdateData() data[i].accum_damage += (last_health - health); if (!data[i].accum_damage_start) data[i].accum_damage_start = g_GlobalVars->curtime; - data[i].last_damage = g_GlobalVars->curtime; + data[i].last_damage = g_GlobalVars->curtime; } } } @@ -616,4 +615,4 @@ bool CanHeal(int idx) return false; return true; } -} +} // namespace hacks::tf::autoheal diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp old mode 100755 new mode 100644 index f0469cef..6c662090 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -137,4 +137,4 @@ void onShutdown() if (auto_queue) tfmm::startQueue(); } -} +} // namespace hacks::shared::autojoin diff --git a/src/hacks/AutoReflect.cpp b/src/hacks/AutoReflect.cpp old mode 100755 new mode 100644 index 6bcd4741..c202079b --- a/src/hacks/AutoReflect.cpp +++ b/src/hacks/AutoReflect.cpp @@ -219,4 +219,4 @@ void Draw() } #endif } -} +} // namespace hacks::tf::autoreflect diff --git a/src/hacks/AutoSticky.cpp b/src/hacks/AutoSticky.cpp old mode 100755 new mode 100644 index 0d46e3e5..1f971d1c --- a/src/hacks/AutoSticky.cpp +++ b/src/hacks/AutoSticky.cpp @@ -182,4 +182,4 @@ void CreateMove() } } } -} +} // namespace hacks::tf::autosticky diff --git a/src/hacks/AutoTaunt.cpp b/src/hacks/AutoTaunt.cpp old mode 100755 new mode 100644 index 80ea24f8..8656204f --- a/src/hacks/AutoTaunt.cpp +++ b/src/hacks/AutoTaunt.cpp @@ -41,4 +41,4 @@ AutoTauntListener listener; InitRoutine init([]() { g_IEventManager2->AddListener(&listener, "player_death", false); }); -} +} // namespace hacks::tf::autotaunt diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp old mode 100755 new mode 100644 index f81f4c06..71e68a20 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -28,7 +28,7 @@ bool shouldBacktrack(); BacktrackData headPositions[32][66]{}; int highesttick[32]{}; int lastincomingsequencenumber = 0; -bool isBacktrackEnabled = false; +bool isBacktrackEnabled = false; circular_buf sequences{ 2048 }; void UpdateIncomingSequences() @@ -133,8 +133,9 @@ void Run() Vector ent_orig = pEntity->InternalEntity()->GetAbsOrigin(); auto hdr = g_IModelInfo->GetStudiomodel(RAW_ENT(pEntity)->GetModel()); headPositions[i][cmd->command_number % getTicks()] = - BacktrackData{ cmd->tick_count, hbdArray, viewangles, simtime, - ent_orig, cmd->command_number % getTicks() }; + BacktrackData{ cmd->tick_count, hbdArray, + viewangles, simtime, + ent_orig, cmd->command_number % getTicks() }; } if (iBestTarget != -1 && CanShoot()) { @@ -208,8 +209,7 @@ bool shouldBacktrack() CachedEntity *wep = g_pLocalPlayer->weapon(); if (CE_BAD(wep)) return false; - int slot = - re::C_BaseCombatWeapon::GetSlot(RAW_ENT(wep)); + int slot = re::C_BaseCombatWeapon::GetSlot(RAW_ENT(wep)); switch ((int) slots) { case 0: diff --git a/src/hacks/Bunnyhop.cpp b/src/hacks/Bunnyhop.cpp old mode 100755 new mode 100644 index fb541479..fe2c0af7 --- a/src/hacks/Bunnyhop.cpp +++ b/src/hacks/Bunnyhop.cpp @@ -50,4 +50,4 @@ void CreateMove() if (!jump) ticks_last_jump = 0; } -} +} // namespace hacks::shared::bunnyhop diff --git a/src/hacks/CMakeLists.txt b/src/hacks/CMakeLists.txt index 6ea8f41e..7112faf7 100755 --- a/src/hacks/CMakeLists.txt +++ b/src/hacks/CMakeLists.txt @@ -28,6 +28,7 @@ if(NOT LagbotMode) "${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp" "${CMAKE_CURRENT_LIST_DIR}/LightESP.cpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.cpp" + "${CMAKE_CURRENT_LIST_DIR}/NavBot.cpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp" "${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp" "${CMAKE_CURRENT_LIST_DIR}/UberSpam.cpp" diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp old mode 100755 new mode 100644 index 5ec16119..0b670a80 --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -368,4 +368,4 @@ void level_init() { level_init_timer.update(); } -} +} // namespace hacks::shared::catbot diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp old mode 100755 new mode 100644 index 20a89af1..01443feb --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -93,21 +93,21 @@ std::mutex entities_need_repaint_mutex{}; // be a pain. // Vars to store what bones connect to what -const std::string bonenames_leg_r[] = { "bip_foot_R", "bip_knee_R", +const std::string bonenames_leg_r[] = { "bip_foot_R", "bip_knee_R", "bip_hip_R" }; -const std::string bonenames_leg_l[] = { "bip_foot_L", "bip_knee_L", +const std::string bonenames_leg_l[] = { "bip_foot_L", "bip_knee_L", "bip_hip_L" }; const std::string bonenames_bottom[] = { "bip_hip_R", "bip_pelvis", "bip_hip_L" }; -const std::string bonenames_spine[] = { "bip_pelvis", "bip_spine_0", +const std::string bonenames_spine[] = { "bip_pelvis", "bip_spine_0", "bip_spine_1", "bip_spine_2", "bip_spine_3", "bip_neck", "bip_head" }; -const std::string bonenames_arm_r[] = { "bip_upperArm_R", "bip_lowerArm_R", +const std::string bonenames_arm_r[] = { "bip_upperArm_R", "bip_lowerArm_R", "bip_hand_R" }; -const std::string bonenames_arm_l[] = { "bip_upperArm_L", "bip_lowerArm_L", +const std::string bonenames_arm_l[] = { "bip_upperArm_L", "bip_lowerArm_L", "bip_hand_L" }; -const std::string bonenames_up[] = { "bip_upperArm_R", "bip_spine_3", +const std::string bonenames_up[] = { "bip_upperArm_R", "bip_spine_3", "bip_upperArm_L" }; // Dont fully understand struct but a guess is a group of something. @@ -141,21 +141,21 @@ struct bonelist_s } try { - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) leg_r[i] = bones.at(bonenames_leg_r[i]); - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) leg_l[i] = bones.at(bonenames_leg_l[i]); - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) bottom[i] = bones.at(bonenames_bottom[i]); - for (int i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) spine[i] = bones.at(bonenames_spine[i]); - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) arm_r[i] = bones.at(bonenames_arm_r[i]); - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) arm_l[i] = bones.at(bonenames_arm_l[i]); for (int i = 0; i < 3; i++) - up[i] = bones.at(bonenames_up[i]); - success = true; + up[i] = bones.at(bonenames_up[i]); + success = true; } catch (std::exception &ex) { @@ -676,12 +676,11 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent) break; case 1: { // BOTTOM RIGHT - draw_point = - Vector(max_x + 2, - max_y - - data.at(ent->m_IDX).string_count * - /*((int)fonts::font_main->height)*/ 14, - 0); + draw_point = Vector( + max_x + 2, + max_y - data.at(ent->m_IDX).string_count * + /*((int)fonts::font_main->height)*/ 14, + 0); } break; case 2: @@ -692,12 +691,11 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent) break; case 3: { // ABOVE - draw_point = - Vector(min_x, - min_y - - data.at(ent->m_IDX).string_count * - /*((int)fonts::font_main->height)*/ 14, - 0); + draw_point = Vector( + min_x, + min_y - data.at(ent->m_IDX).string_count * + /*((int)fonts::font_main->height)*/ 14, + 0); } break; case 4: @@ -1567,4 +1565,4 @@ void SetEntityColor(CachedEntity *entity, const rgba_t &color) { data[entity->m_IDX].color = color; } -} +} // namespace hacks::shared::esp diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp old mode 100755 new mode 100644 index 7852b346..f711ed84 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -37,7 +37,6 @@ CatCommand follow_steam("fb_steam", "Follow Steam Id", return; } steamid = atol(args.Arg(1)); - }); // Something to store breadcrumbs created by followed players @@ -98,8 +97,8 @@ void addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin) int maxiterations = floor(corner.DistTo(target->m_vecOrigin())) / 40; for (int i = 0; i < maxiterations; i++) { - breadcrumbs.push_back( - corner + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1)); + breadcrumbs.push_back(corner + dist / vectorMax(vectorAbs(dist)) * + 40.0f * (i + 1)); } } @@ -124,8 +123,8 @@ void addCrumbPair(CachedEntity *player1, CachedEntity *player2, int maxiterations = floor(corner2.DistTo(corner1)) / 40; for (int i = 0; i < maxiterations; i++) { - breadcrumbs.push_back( - corner1 + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1)); + breadcrumbs.push_back(corner1 + dist / vectorMax(vectorAbs(dist)) * + 40.0f * (i + 1)); } } { @@ -133,8 +132,8 @@ void addCrumbPair(CachedEntity *player1, CachedEntity *player2, int maxiterations = floor(corner2.DistTo(player2->m_vecOrigin())) / 40; for (int i = 0; i < maxiterations; i++) { - breadcrumbs.push_back( - corner2 + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1)); + breadcrumbs.push_back(corner2 + dist / vectorMax(vectorAbs(dist)) * + 40.0f * (i + 1)); } } } @@ -581,4 +580,4 @@ static CatCommand } }); #endif -} +} // namespace hacks::shared::followbot diff --git a/src/hacks/KillSay.cpp b/src/hacks/KillSay.cpp old mode 100755 new mode 100644 index cabee11b..0c85864c --- a/src/hacks/KillSay.cpp +++ b/src/hacks/KillSay.cpp @@ -158,4 +158,4 @@ const std::vector builtin_nonecore_mlg = { "GET REKT U SCRUB", "GET REKT M8", "U GOT NOSCOPED M8", "U GOT QUICKSCOPED M8", "2 FAST 4 U, SCRUB", "U GOT REKT, M8" }; -} +} // namespace hacks::shared::killsay diff --git a/src/hacks/Killstreak.cpp b/src/hacks/Killstreak.cpp old mode 100755 new mode 100644 index 8bc02a3a..0cb50d6d --- a/src/hacks/Killstreak.cpp +++ b/src/hacks/Killstreak.cpp @@ -134,4 +134,4 @@ bool FireEventClientSide(IGameEventManager2 *manager, IGameEvent *event) void init() { } -} +} // namespace hacks::tf2::killstreak diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp old mode 100755 new mode 100644 index 1c330031..d5e8a03f --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -80,4 +80,4 @@ rgba_t LightESPColor(CachedEntity *ent) } return colors::green; } -} +} // namespace hacks::shared::lightesp diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp old mode 100755 new mode 100644 index 8387a87e..be1c4efc --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -175,7 +175,7 @@ void CreateMove() { if (flash_light_spam_switch && !current_user_cmd->impulse) current_user_cmd->impulse = 100; - flash_light_spam_switch = !flash_light_spam_switch; + flash_light_spam_switch = !flash_light_spam_switch; } } diff --git a/src/hacks/NavBot.cpp b/src/hacks/NavBot.cpp new file mode 100644 index 00000000..89b970ba --- /dev/null +++ b/src/hacks/NavBot.cpp @@ -0,0 +1,211 @@ +// +// Created by bencat07 on 17.08.18. +// +#include "common.hpp" +#include "navparser.hpp" +#include "NavBot.hpp" + +namespace hacks::tf2::NavBot +{ +static settings::Bool enable("navbot.enable", "false"); +static settings::Bool spy_mode("navbot.spy-mode", "false"); +static settings::Bool heavy_mode("navbot.heavy-mode", "false"); +static settings::Bool primary_only("navbot.primary-only", "true"); + +bool HasLowAmmo() +{ + int *weapon_list = + (int *) ((unsigned) (RAW_ENT(LOCAL_E)) + netvar.hMyWeapons); + for (int i = 0; weapon_list[i]; i++) + { + int handle = weapon_list[i]; + int eid = handle & 0xFFF; + if (eid >= 32 && eid <= HIGHEST_ENTITY) + { + IClientEntity *weapon = g_IEntityList->GetClientEntity(eid); + if (weapon and + re::C_BaseCombatWeapon::IsBaseCombatWeapon(weapon) and + re::C_TFWeaponBase::UsesPrimaryAmmo(weapon) and + not re::C_TFWeaponBase::HasPrimaryAmmo(weapon)) + return true; + } + } + return false; +} + +bool HasLowHealth() +{ + return float(LOCAL_E->m_iHealth()) / float(LOCAL_E->m_iMaxHealth()) < 0.64; +} + +CachedEntity *nearestHealth() +{ + float bestscr = FLT_MAX; + CachedEntity *bestent = nullptr; + for (int i = 0; i < HIGHEST_ENTITY; i++) + { + CachedEntity *ent = ENTITY(i); + if (CE_BAD(ent) || ent->m_iClassID() != CL_CLASS(CBaseAnimating)) + continue; + if (ent->m_ItemType() != ITEM_HEALTH_SMALL && + ent->m_ItemType() != ITEM_HEALTH_MEDIUM && + ent->m_ItemType() != ITEM_HEALTH_LARGE) + continue; + if (ent->m_flDistance() < bestscr) + { + bestscr = ent->m_flDistance(); + bestent = ent; + } + } + return bestent; +} +CachedEntity *nearestAmmo() +{ + float bestscr = FLT_MAX; + CachedEntity *bestent = nullptr; + for (int i = 0; i < HIGHEST_ENTITY; i++) + { + CachedEntity *ent = ENTITY(i); + if (CE_BAD(ent) || ent->m_iClassID() != CL_CLASS(CBaseAnimating)) + continue; + if (ent->m_ItemType() != ITEM_AMMO_SMALL && + ent->m_ItemType() != ITEM_AMMO_MEDIUM && + ent->m_ItemType() != ITEM_AMMO_LARGE) + continue; + if (ent->m_flDistance() < bestscr) + { + bestscr = ent->m_flDistance(); + bestent = ent; + } + } + return bestent; +} +CachedEntity *NearestEnemy() +{ + float bestscr = FLT_MAX; + CachedEntity *bestent = nullptr; + for (int i = 0; i < g_IEngine->GetMaxClients(); i++) + { + CachedEntity *ent = ENTITY(i); + if (CE_BAD(ent) || ent->m_Type() != ENTITY_PLAYER) + continue; + if (ent == LOCAL_E || !ent->m_bAlivePlayer() || + ent->m_iTeam() == LOCAL_E->m_iTeam()) + continue; + float scr = ent->m_flDistance(); + if (g_pPlayerResource->GetClass(ent) == tf_engineer) + scr *= 5.0f; + if (g_pPlayerResource->GetClass(ent) == tf_pyro) + scr *= 7.0f; + if (scr < bestscr) + { + bestscr = scr; + bestent = ent; + } + } + return bestent; +} +std::vector sniper_spots; +void Init() +{ + sniper_spots.clear(); + for (auto area : nav::areas) + for (auto hide : area.m_hidingSpots) + if (hide.IsGoodSniperSpot() || hide.IsIdealSniperSpot() || + hide.IsExposed()) + sniper_spots.push_back(hide.m_pos); +} +Timer slot_timer{}; +void UpdateSlot() +{ + if (!slot_timer.test_and_set(1000)) + return; + if (CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) && !g_pLocalPlayer->life_state) + { + IClientEntity *weapon = RAW_ENT(LOCAL_W); + // IsBaseCombatWeapon() + if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(weapon)) + { + int slot = re::C_BaseCombatWeapon::GetSlot(weapon); + int newslot = 1; + if (spy_mode) + newslot = 3; + if (slot != newslot - 1) + g_IEngine->ClientCmd_Unrestricted( + format("slot", newslot).c_str()); + } + } +} +Timer cdr{}; +Timer cd2{}; +Timer cd3{}; +void CreateMove() +{ + if ( !enable || !nav::Prepare()) + return; + if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer()) + return; + if (primary_only) + UpdateSlot(); + if (HasLowHealth() && cdr.test_and_set(5000)) + { + CachedEntity *med = nearestHealth(); + if (CE_GOOD(med)) + { + nav::NavTo(med->m_vecOrigin()); + return; + } + } + if (HasLowAmmo() && cdr.test_and_set(5000)) + { + CachedEntity *ammo = nearestAmmo(); + if (CE_GOOD(ammo)) + { + nav::NavTo(ammo->m_vecOrigin()); + return; + } + } + if (!nav::ReadyForCommands && !spy_mode) + cd3.update(); + bool isready = (spy_mode || heavy_mode) ? 1 : nav::ReadyForCommands; + int waittime = (spy_mode || heavy_mode) ? 100 : 5000; + if (isready && cd3.test_and_set(waittime)) + { + if (!spy_mode && !heavy_mode) + { + cd3.update(); + Vector random_spot; + if (sniper_spots.empty()) + { + if (cd2.test_and_set(5000)) + Init(); + return; + } + int rng = rand() % sniper_spots.size(); + random_spot = sniper_spots.at(rng); + if (random_spot.z) + nav::NavTo(random_spot, false); + } + else + { + CachedEntity *tar = NearestEnemy(); + if (CE_BAD(tar)) + { + Vector random_spot; + if (sniper_spots.empty()) + { + if (cd2.test_and_set(5000)) + Init(); + return; + } + int rng = rand() % sniper_spots.size(); + random_spot = sniper_spots.at(rng); + if (random_spot.z) + nav::NavTo(random_spot, false); + return; + } + nav::NavTo(tar->m_vecOrigin(), false); + } + } +} +} // namespace hacks::tf2::NavBot diff --git a/src/hacks/Noisemaker.cpp b/src/hacks/Noisemaker.cpp old mode 100755 new mode 100644 index 7a5e8fa1..38c06229 --- a/src/hacks/Noisemaker.cpp +++ b/src/hacks/Noisemaker.cpp @@ -26,4 +26,4 @@ void CreateMove() } } } -} +} // namespace hacks::tf2::noisemaker diff --git a/src/hacks/Radar.cpp b/src/hacks/Radar.cpp old mode 100755 new mode 100644 index ad227bc1..9899ffa2 --- a/src/hacks/Radar.cpp +++ b/src/hacks/Radar.cpp @@ -265,7 +265,7 @@ void Draw() glez::draw::line(x + half_size / 2, y + half_size, half_size, 0, colors::Transparent(GUIColor(), 0.4f), 0.5f); } -} +} // namespace hacks::tf::radar #endif #endif diff --git a/src/hacks/SeedPrediction.cpp b/src/hacks/SeedPrediction.cpp old mode 100755 new mode 100644 index 5919c584..8566bd56 --- a/src/hacks/SeedPrediction.cpp +++ b/src/hacks/SeedPrediction.cpp @@ -162,10 +162,10 @@ int predictTick() int predictSeed(double targetTime) { - INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); - double ping = ch ? ch->GetLatency(MAX_FLOWS) / 2 : 0.0f; - double deltaTime = targetTime - selected.time + ping; - int tick = int(double(selected.tickcount) + + INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); + double ping = ch ? ch->GetLatency(MAX_FLOWS) / 2 : 0.0f; + double deltaTime = targetTime - selected.time + ping; + int tick = int(double(selected.tickcount) + deltaTime / g_GlobalVars->interval_per_tick + 0.7); double SeedOffset = predictOffset(selected, tick, clockRes); int seed = predictSeed(selected, tick, clockRes, SeedOffset); @@ -190,4 +190,4 @@ void reset() clockRes = 2.0; } } -} +} // namespace hacks::tf2::seedprediction diff --git a/src/hacks/SkinChanger.cpp b/src/hacks/SkinChanger.cpp old mode 100755 new mode 100644 index 1334b68e..a2bc9095 --- a/src/hacks/SkinChanger.cpp +++ b/src/hacks/SkinChanger.cpp @@ -515,4 +515,4 @@ std::unordered_map modifier_map{}; // A map that maps an Entity Index to a cookie // std::unordered_map cookie_map {}; patched_weapon_cookie cookie{ 0 }; -} +} // namespace hacks::tf2::skinchanger diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp old mode 100755 new mode 100644 index 656c3286..659423cd --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -427,7 +427,7 @@ const std::vector builtin_lithium = { "SAVE YOUR MONEY AND GET LITHIUMCHEAT! IT IS FREE!", "GOT ROLLED BY LITHIUM? HEY, THAT MEANS IT'S TIME TO GET LITHIUMCHEAT!!" }; -} +} // namespace hacks::shared::spam static CatCommand reload("spam_reload", "Reload spam file", hacks::shared::spam::reloadSpamFile); diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp old mode 100755 new mode 100644 index eff49e19..13e5b194 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -69,9 +69,8 @@ void Draw() { if (!backstab_triggered) { - if (sound_alert && - (g_GlobalVars->curtime - last_say) > - (float) sound_alert_interval) + if (sound_alert && (g_GlobalVars->curtime - last_say) > + (float) sound_alert_interval) { g_ISurface->PlaySound("vo/demoman_cloakedspy03.mp3"); last_say = g_GlobalVars->curtime; @@ -90,9 +89,8 @@ void Draw() backstab_triggered = false; if (!warning_triggered) { - if (sound_alert && - (g_GlobalVars->curtime - last_say) > - (float) sound_alert_interval) + if (sound_alert && (g_GlobalVars->curtime - last_say) > + (float) sound_alert_interval) { g_ISurface->PlaySound("vo/demoman_cloakedspy01.mp3"); last_say = g_GlobalVars->curtime; @@ -113,4 +111,4 @@ void Draw() backstab_triggered = false; } } -} +} // namespace hacks::tf::spyalert diff --git a/src/hacks/Thirdperson.cpp b/src/hacks/Thirdperson.cpp old mode 100755 new mode 100644 index cb462b87..1162538d --- a/src/hacks/Thirdperson.cpp +++ b/src/hacks/Thirdperson.cpp @@ -28,7 +28,7 @@ void hacks::tf::thirdperson::frameStageNotify() { // Remove thirdperson CE_INT(LOCAL_E, netvar.nForceTauntCam) = 0; - was_enabled = false; + was_enabled = false; } if (angles && g_IInput->CAM_IsThirdPerson()) { diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp old mode 100755 new mode 100644 index 9ba10f8f..fe7c254c --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -669,4 +669,4 @@ bool CheckLineBox(Vector B1, Vector B2, Vector L1, Vector L2, Vector &Hit) void Draw() { } -} +} // namespace hacks::shared::triggerbot diff --git a/src/hacks/UberSpam.cpp b/src/hacks/UberSpam.cpp old mode 100755 new mode 100644 index 28ffb8e9..28210655 --- a/src/hacks/UberSpam.cpp +++ b/src/hacks/UberSpam.cpp @@ -128,4 +128,4 @@ const std::vector builtin_nonecore = { ">>> GET READY TO RUMBLE! <<<", ">>> CHEATS ACTIVATED! <<<", ">>> RUMBLE COMPLETE! <<<", ">>> RUMBLE IS %i%% CHARGED! <<<" }; -} +} // namespace hacks::tf::uberspam diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp old mode 100755 new mode 100644 index ea52da52..4810a814 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -236,10 +236,10 @@ index_t free_node() nodes.emplace_back(); return nodes.size() - 1; } -} +} // namespace state -using state::nodes; using state::node_good; +using state::nodes; bool HasLowAmmo() { @@ -507,7 +507,6 @@ CatCommand c_split_connection("wb_split", "Split connection", []() { n.link(state::active_node); b.link(node); n.link(state::closest_node); - }); // Deletes closest node and its connections CatCommand c_delete_node("wb_delete", "Delete node", @@ -1286,4 +1285,4 @@ void Move() break; } } -} +} // namespace hacks::shared::walkbot diff --git a/src/hacks/ac/aimbot.cpp b/src/hacks/ac/aimbot.cpp old mode 100755 new mode 100644 index f0d0af08..917dcfc3 --- a/src/hacks/ac/aimbot.cpp +++ b/src/hacks/ac/aimbot.cpp @@ -120,4 +120,4 @@ void Event(KeyValues *event) } } } -} +} // namespace ac::aimbot diff --git a/src/hacks/ac/antiaim.cpp b/src/hacks/ac/antiaim.cpp old mode 100755 new mode 100644 index 4872e330..70f48475 --- a/src/hacks/ac/antiaim.cpp +++ b/src/hacks/ac/antiaim.cpp @@ -75,4 +75,4 @@ void Update(CachedEntity *player) void Event(KeyValues *event) { } -} +} // namespace ac::antiaim diff --git a/src/hacks/ac/bhop.cpp b/src/hacks/ac/bhop.cpp old mode 100755 new mode 100644 index 2586066e..f2a5ac2d --- a/src/hacks/ac/bhop.cpp +++ b/src/hacks/ac/bhop.cpp @@ -81,4 +81,4 @@ void Update(CachedEntity *player) void Event(KeyValues *event) { } -} +} // namespace ac::bhop diff --git a/src/helpers.cpp b/src/helpers.cpp old mode 100755 new mode 100644 index 05e6ec22..11e808b6 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -1010,7 +1010,7 @@ bool GetProjectileData(CachedEntity *weapon, float &speed, float &gravity) g_GlobalVars->curtime - CE_FLOAT(weapon, netvar.flChargeBeginTime); rspeed = (float) ((float) (fminf(fmaxf(chargetime, 0.0), 1.0) * 800.0) + 1800.0); - rgrav = (float) ((float) (fminf(fmaxf(chargetime, 0.0), 1.0) * + rgrav = (float) ((float) (fminf(fmaxf(chargetime, 0.0), 1.0) * -0.40000001) + 0.5); break; @@ -1335,7 +1335,6 @@ bool IsEntityVisiblePenetration(CachedEntity *entity, int hb) CatCommand print_classnames( "debug_print_classnames", "Lists classnames currently available in console", []() { - // Create a tmp ent for the loop CachedEntity *ent; @@ -1353,7 +1352,6 @@ CatCommand print_classnames( logging::Info( format(RAW_ENT(ent)->GetClientClass()->m_pNetworkName).c_str()); } - }); void PrintChat(const char *fmt, ...) diff --git a/src/hitrate.cpp b/src/hitrate.cpp old mode 100755 new mode 100644 index db77c73d..89aa68ff --- a/src/hitrate.cpp +++ b/src/hitrate.cpp @@ -190,4 +190,4 @@ HurtListener &listener() InitRoutine init([]() { g_IGameEventManager->AddListener(&listener(), false); }); -} +} // namespace hitrate diff --git a/src/hooks.cpp b/src/hooks.cpp old mode 100755 new mode 100644 index 7e0214ea..dd3b3dc2 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -83,7 +83,7 @@ void VMTHook::HookMethod(ptr_t func, uint32_t idx, ptr_t *backup) "Hooking method %d of vtable 0x%08x, replacing 0x%08x with 0x%08x", idx, vtable_original, GetMethod(idx), func); if (backup) - *backup = vtable_hooked[2 + idx]; + *backup = vtable_hooked[2 + idx]; vtable_hooked[2 + idx] = func; } @@ -113,4 +113,4 @@ VMTHook materialsystem{}; VMTHook enginevgui{}; VMTHook vstd{}; VMTHook eventmanager2{}; -} +} // namespace hooks diff --git a/src/hooks/CanPacket.cpp b/src/hooks/CanPacket.cpp old mode 100755 new mode 100644 index a9a8f529..efb089af --- a/src/hooks/CanPacket.cpp +++ b/src/hooks/CanPacket.cpp @@ -12,4 +12,4 @@ DEFINE_HOOKED_METHOD(CanPacket, bool, INetChannel *this_) { return original::CanPacket(this_); } -} +} // namespace hooked_methods diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp old mode 100755 new mode 100644 index 6a9cc693..2bbffea3 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -13,6 +13,7 @@ #include #include #include +#include "NavBot.hpp" #include "HookedMethods.hpp" @@ -93,7 +94,7 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd) return; } -} +} // namespace engine_prediction #if not LAGBOT_MODE #define antikick_time 35 #else @@ -126,6 +127,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, if (firstcm) { DelayTimer.update(); + hacks::tf2::NavBot::Init(); firstcm = false; } tickcount++; @@ -269,6 +271,14 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, PROF_SECTION(CM_walkbot); hacks::shared::walkbot::Move(); } + { + PROF_SECTION(CM_navbot); + nav::CreateMove(); + } + { + PROF_SECTION(CM_NavParse); + hacks::tf2::NavBot::CreateMove(); + } // Walkbot can leave game. if (!g_IEngine->IsInGame()) { @@ -392,7 +402,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, } if (time_replaced) g_GlobalVars->curtime = curtime_old; - g_Settings.bInvalid = false; + g_Settings.bInvalid = false; #if !LAGBOT_MODE { PROF_SECTION(CM_chat_stack); @@ -400,7 +410,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, } #endif -// TODO Auto Steam Friend + // TODO Auto Steam Friend #if ENABLE_IPC { @@ -492,7 +502,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, g_Settings.is_create_move = false; return ret; } -} +} // namespace hooked_methods /*float o_curtime; float o_frametime; diff --git a/src/hooks/DispatchUserMessage.cpp b/src/hooks/DispatchUserMessage.cpp old mode 100755 new mode 100644 index 348f5400..f16750e2 --- a/src/hooks/DispatchUserMessage.cpp +++ b/src/hooks/DispatchUserMessage.cpp @@ -50,9 +50,9 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type, if (s < 256) { data = (char *) alloca(s); - for (i = 0; i < s; i++) + for (i = 0; i < s; i++) data[i] = buf.ReadByte(); - j = 0; + j = 0; std::string name; std::string message; for (i = 0; i < 3; i++) @@ -264,4 +264,4 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type, votelogger::dispatchUserMessage(buf, type); return original::DispatchUserMessage(this_, type, buf); } -} +} // namespace hooked_methods diff --git a/src/hooks/FireEvent.cpp b/src/hooks/FireEvent.cpp old mode 100755 new mode 100644 index 73cf86e4..7ecb4892 --- a/src/hooks/FireEvent.cpp +++ b/src/hooks/FireEvent.cpp @@ -13,4 +13,4 @@ DEFINE_HOOKED_METHOD(FireEvent, bool, IGameEventManager2 *this_, { return original::FireEvent(this_, event, no_broadcast); } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/FireEventClientSide.cpp b/src/hooks/FireEventClientSide.cpp old mode 100755 new mode 100644 index e7646693..7a3a91cf --- a/src/hooks/FireEventClientSide.cpp +++ b/src/hooks/FireEventClientSide.cpp @@ -13,4 +13,4 @@ DEFINE_HOOKED_METHOD(FireEventClientSide, bool, IGameEventManager2 *this_, { return original::FireEventClientSide(this_, event); } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/FireGameEvent.cpp b/src/hooks/FireGameEvent.cpp old mode 100755 new mode 100644 index ca47a097..e18b0545 --- a/src/hooks/FireGameEvent.cpp +++ b/src/hooks/FireGameEvent.cpp @@ -29,4 +29,4 @@ DEFINE_HOOKED_METHOD(FireGameEvent, void, void *this_, IGameEvent *event) } original::FireGameEvent(this_, event); } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/GetFriendPersonaName.cpp b/src/hooks/GetFriendPersonaName.cpp old mode 100755 new mode 100644 index 1ebaca78..bb3cc961 --- a/src/hooks/GetFriendPersonaName.cpp +++ b/src/hooks/GetFriendPersonaName.cpp @@ -143,4 +143,4 @@ DEFINE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *this_, } return original::GetFriendPersonaName(this_, steam_id); } -} +} // namespace hooked_methods diff --git a/src/hooks/GetUserCmd.cpp b/src/hooks/GetUserCmd.cpp old mode 100755 new mode 100644 index 07501f0e..1f0cad66 --- a/src/hooks/GetUserCmd.cpp +++ b/src/hooks/GetUserCmd.cpp @@ -38,4 +38,4 @@ DEFINE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *this_, int sequence_number) } return def; } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/IsPlayingTimeDemo.cpp b/src/hooks/IsPlayingTimeDemo.cpp old mode 100755 new mode 100644 index 0d6c6c4b..32ea021c --- a/src/hooks/IsPlayingTimeDemo.cpp +++ b/src/hooks/IsPlayingTimeDemo.cpp @@ -16,4 +16,4 @@ DEFINE_HOOKED_METHOD(IsPlayingTimeDemo, bool) else return original::IsPlayingTimeDemo(); } -} +} // namespace hooked_methods diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp old mode 100755 new mode 100644 index fe588767..39b7178f --- a/src/hooks/LevelInit.cpp +++ b/src/hooks/LevelInit.cpp @@ -8,6 +8,7 @@ #include #include "HookedMethods.hpp" #include "MiscTemporary.hpp" +#include "navparser.hpp" #if !LAGBOT_MODE #include "hacks/Backtrack.hpp" #endif @@ -57,7 +58,8 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) hacks::shared::backtrack::sequences.clear(); #endif hacks::shared::autojoin::resetQueueTimer(); - firstcm = true; + firstcm = true; + nav::init = false; #if !LAGBOT_MODE playerlist::Save(); #endif @@ -76,7 +78,7 @@ 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++) + for (int i = 0; i < 32; i++) g_Settings.brute.brutenum[i] = 0; if (halloween_mode) holiday->SetValue(2); @@ -101,4 +103,4 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) } #endif } -} +} // namespace hooked_methods diff --git a/src/hooks/LevelShutdown.cpp b/src/hooks/LevelShutdown.cpp old mode 100755 new mode 100644 index 7bf46773..b395599a --- a/src/hooks/LevelShutdown.cpp +++ b/src/hooks/LevelShutdown.cpp @@ -32,4 +32,4 @@ DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_) #endif return original::LevelShutdown(this_); } -} +} // namespace hooked_methods diff --git a/src/hooks/Paint.cpp b/src/hooks/Paint.cpp old mode 100755 new mode 100644 index 28f57ad5..eb4ef9c8 --- a/src/hooks/Paint.cpp +++ b/src/hooks/Paint.cpp @@ -95,4 +95,4 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode) return original::Paint(this_, mode); } -} +} // namespace hooked_methods diff --git a/src/hooks/PreDataUpdate.cpp b/src/hooks/PreDataUpdate.cpp old mode 100755 new mode 100644 index 5d718ff5..3c2c23c1 --- a/src/hooks/PreDataUpdate.cpp +++ b/src/hooks/PreDataUpdate.cpp @@ -14,4 +14,4 @@ DEFINE_HOOKED_METHOD(PreDataUpdate, void, void *_this, int ok) hacks::tf2::seedprediction::handleFireBullets((C_TEFireBullets *) _this); original::PreDataUpdate(_this, ok); } -} +} // namespace hooked_methods diff --git a/src/hooks/SendDatagram.cpp b/src/hooks/SendDatagram.cpp old mode 100755 new mode 100644 index ee47631d..71154e6c --- a/src/hooks/SendDatagram.cpp +++ b/src/hooks/SendDatagram.cpp @@ -36,4 +36,4 @@ DEFINE_HOOKED_METHOD(SendDatagram, int, INetChannel *ch, bf_write *buf) #endif return ret; } -} +} // namespace hooked_methods diff --git a/src/hooks/SendNetMsg.cpp b/src/hooks/SendNetMsg.cpp old mode 100755 new mode 100644 index 7ecf338f..9e1b2b2a --- a/src/hooks/SendNetMsg.cpp +++ b/src/hooks/SendNetMsg.cpp @@ -86,4 +86,4 @@ DEFINE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *this_, INetMessage &msg, } return original::SendNetMsg(this_, msg, force_reliable, voice); } -} +} // namespace hooked_methods diff --git a/src/hooks/Shutdown.cpp b/src/hooks/Shutdown.cpp old mode 100755 new mode 100644 index cec0cdb1..ad18fd3f --- a/src/hooks/Shutdown.cpp +++ b/src/hooks/Shutdown.cpp @@ -50,4 +50,4 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason) } hacks::shared::autojoin::onShutdown(); } -} +} // namespace hooked_methods diff --git a/src/hooks/visual/BeginFrame.cpp b/src/hooks/visual/BeginFrame.cpp old mode 100755 new mode 100644 index 48a53e12..26ef437a --- a/src/hooks/visual/BeginFrame.cpp +++ b/src/hooks/visual/BeginFrame.cpp @@ -12,4 +12,4 @@ DEFINE_HOOKED_METHOD(BeginFrame, void, IStudioRender *this_) { return original::BeginFrame(this_); } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/visual/DrawModelExecute.cpp b/src/hooks/visual/DrawModelExecute.cpp old mode 100755 new mode 100644 index e4964873..5cae7320 --- a/src/hooks/visual/DrawModelExecute.cpp +++ b/src/hooks/visual/DrawModelExecute.cpp @@ -70,4 +70,4 @@ DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_, return original::DrawModelExecute(this_, state, info, bone); } -} +} // namespace hooked_methods diff --git a/src/hooks/visual/FrameStageNotify.cpp b/src/hooks/visual/FrameStageNotify.cpp old mode 100755 new mode 100644 index 2c18184b..29d5382c --- a/src/hooks/visual/FrameStageNotify.cpp +++ b/src/hooks/visual/FrameStageNotify.cpp @@ -124,4 +124,4 @@ DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_, } return original::FrameStageNotify(this_, stage); } -} +} // namespace hooked_methods diff --git a/src/hooks/visual/IN_KeyEvent.cpp b/src/hooks/visual/IN_KeyEvent.cpp old mode 100755 new mode 100644 index 7ec5742f..8bcef897 --- a/src/hooks/visual/IN_KeyEvent.cpp +++ b/src/hooks/visual/IN_KeyEvent.cpp @@ -20,4 +20,4 @@ if (g_pGUI->ConsumesKey((ButtonCode_t)keynum) && g_pGUI->Visible()) { #endif return original::IN_KeyEvent(this_, eventcode, keynum, binding); } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/visual/OverrideView.cpp b/src/hooks/visual/OverrideView.cpp old mode 100755 new mode 100644 index 3d13181e..1a40dc34 --- a/src/hooks/visual/OverrideView.cpp +++ b/src/hooks/visual/OverrideView.cpp @@ -84,4 +84,4 @@ DEFINE_HOOKED_METHOD(OverrideView, void, void *this_, CViewSetup *setup) draw::fov = setup->fov; } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/visual/PaintTraverse.cpp b/src/hooks/visual/PaintTraverse.cpp old mode 100755 new mode 100644 index 1cc588f2..627dfa2c --- a/src/hooks/visual/PaintTraverse.cpp +++ b/src/hooks/visual/PaintTraverse.cpp @@ -221,7 +221,7 @@ label1: } if (*pure_addr) pure_orig = *pure_addr; - *pure_addr = (void *) 0; + *pure_addr = (void *) 0; } else if (pure_orig) { @@ -322,4 +322,4 @@ label1: #endif draw::UpdateWTS(); } -} +} // namespace hooked_methods diff --git a/src/hooks/visual/RandomInt.cpp b/src/hooks/visual/RandomInt.cpp old mode 100755 new mode 100644 index 85e72e65..f3c01605 --- a/src/hooks/visual/RandomInt.cpp +++ b/src/hooks/visual/RandomInt.cpp @@ -19,4 +19,4 @@ DEFINE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *this_, int min, return original::RandomInt(this_, min, max); } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/hooks/visual/SDL_GL_SwapWindow.cpp b/src/hooks/visual/SDL_GL_SwapWindow.cpp old mode 100755 new mode 100644 index 6c20ad2f..684115a3 --- a/src/hooks/visual/SDL_GL_SwapWindow.cpp +++ b/src/hooks/visual/SDL_GL_SwapWindow.cpp @@ -63,4 +63,4 @@ DEFINE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *window) // glXSwapBuffers(wminfo.info.x11.display, wminfo.info.x11.window); } } -} +} // namespace hooked_methods diff --git a/src/hooks/visual/SDL_PollEvent.cpp b/src/hooks/visual/SDL_PollEvent.cpp old mode 100755 new mode 100644 index a36e9aac..df90624f --- a/src/hooks/visual/SDL_PollEvent.cpp +++ b/src/hooks/visual/SDL_PollEvent.cpp @@ -18,4 +18,4 @@ DEFINE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *event) #endif return ret; } -} \ No newline at end of file +} // namespace hooked_methods \ No newline at end of file diff --git a/src/https_request.cpp b/src/https_request.cpp old mode 100755 new mode 100644 index bef6cf47..7da88bd4 --- a/src/https_request.cpp +++ b/src/https_request.cpp @@ -96,8 +96,8 @@ std::string RAII_HTTPS_Socket::get(const std::string &path) int rq_length = snprintf(buffer_rq.get(), rq_size, "GET %s HTTP/1.0\r\nHost: %s\r\n\r\n", path.c_str(), hostname_.c_str()); - int sent = 0; - int chunk = 0; + int sent = 0; + int chunk = 0; do { chunk = @@ -141,4 +141,4 @@ void initialize() ssl_context = SSL_CTX_new(SSLv23_client_method()); initialized = true; } -} +} // namespace https diff --git a/src/ipc.cpp b/src/ipc.cpp old mode 100755 new mode 100644 index 1c9812d4..ca4f3b5d --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -72,7 +72,6 @@ CatCommand connect("ipc_connect", "Connect to IPC server", []() { delete peer; peer = nullptr; } - }); CatCommand disconnect("ipc_disconnect", "Disconnect from IPC server", []() { if (peer) @@ -265,8 +264,9 @@ void StoreClientData() user_data_s &data = peer->memory->peer_user_data[peer->client_id]; data.friendid = g_ISteamUser->GetSteamID().GetAccountID(); data.ts_injected = time_injected; - strncpy(data.name, hooked_methods::methods::GetFriendPersonaName( - g_ISteamFriends, g_ISteamUser->GetSteamID()), + strncpy(data.name, + hooked_methods::methods::GetFriendPersonaName( + g_ISteamFriends, g_ISteamUser->GetSteamID()), sizeof(data.name)); } @@ -292,6 +292,6 @@ void UpdatePlayerlist() } } } -} +} // namespace ipc #endif diff --git a/src/navparser.cpp b/src/navparser.cpp old mode 100755 new mode 100644 index 599ded82..7f337a75 --- a/src/navparser.cpp +++ b/src/navparser.cpp @@ -1,61 +1,422 @@ -#include "common.hpp" -namespace nav { - CNavFile navfile(0); - CNavArea LocalNav; - std::vector areas; - std::vector SniperAreas; - void Init(const char *lvlname) +#include "navparser.hpp" + +namespace nav +{ +static CNavFile navfile(nullptr); +std::vector areas; +// std::vector SniperAreas; +bool init = false; +bool pathfinding = true; +bool ReadyForCommands = false; +std::vector> ignoredConnections; + +static settings::Bool enabled{ "misc.pathing", "true" }; + +// Todo fix +int FindInVector(int id) +{ + for (int i = 0; i < areas.size(); i++) { - for (auto &it : areas) - it = {}; - navfile = CNavFile(lvlname); - if (!navfile.m_isOK) - logging::Info("Invalid Nav File"); + if (areas.at(i).m_id == id) + return i; + } +} + +struct MAP : public micropather::Graph +{ + std::unique_ptr pather; + bool IsIgnored(int currState, int connectionID) + { + for (int i = 0; i < ignoredConnections.size(); i++) + { + if (ignoredConnections.at(i).first == currState && + ignoredConnections.at(i).second == connectionID) + { + return true; + } + } + return false; + } + Vector GetClosestCornerToArea(CNavArea *CornerOf, CNavArea *Target) + { + std::array corners; + corners.at(0) = CornerOf->m_nwCorner; // NW + corners.at(1) = CornerOf->m_seCorner; // SE + corners.at(2) = Vector{ CornerOf->m_seCorner.x, CornerOf->m_nwCorner.y, + CornerOf->m_nwCorner.z }; // NE + corners.at(3) = Vector{ CornerOf->m_nwCorner.x, CornerOf->m_seCorner.y, + CornerOf->m_seCorner.z }; // SW + + Vector bestVec; + float bestDist = FLT_MAX; + + for (int i = 0; i < corners.size(); i++) + { + float dist = corners.at(i).DistTo(Target->m_center); + if (dist < bestDist) + { + bestVec = corners.at(i); + bestDist = dist; + } + } + + Vector bestVec2; + float bestDist2 = FLT_MAX; + + for (int i = 0; i < corners.size(); i++) + { + if (corners.at(i) == bestVec2) + continue; + float dist = corners.at(i).DistTo(Target->m_center); + if (dist < bestDist2) + { + bestVec2 = corners.at(i); + bestDist2 = dist; + } + } + return (bestVec + bestVec2) / 2; + } + + float GetZBetweenAreas(CNavArea *start, CNavArea *end) + { + float z1 = GetClosestCornerToArea(start, end).z; + float z2 = GetClosestCornerToArea(end, start).z; + + return z2 - z1; + } + float LeastCostEstimate(void *stateStart, void *stateEnd) + { + CNavArea *start = static_cast(stateStart); + CNavArea *end = static_cast(stateEnd); + float dist = start->m_center.DistTo(end->m_center); + return dist; + } + void AdjacentCost(void *state, MP_VECTOR *adjacent) + { + CNavArea *area = static_cast(state); + auto &neighbours = area->m_connections; + for (auto i : neighbours) + { + if (GetZBetweenAreas(area, i.area) > 42) + continue; + if (IsIgnored(area->m_id, i.area->m_id)) + continue; + micropather::StateCost cost; + cost.state = + static_cast(&areas.at(FindInVector(i.area->m_id))); + cost.cost = area->m_center.DistTo(i.area->m_center); + adjacent->push_back(cost); + } + } + void PrintStateInfo(void *state) + { + } + MAP(size_t size) + { + pather = + std::make_unique(this, size, 6, true); + } + + ~MAP() + { + } +}; + +std::unique_ptr TF2MAP; + +void Init() +{ + // TODO: Improve performance + std::string lvlname(g_IEngine->GetLevelName()); + int dotpos = lvlname.find('.'); + lvlname = lvlname.substr(0, dotpos); + + std::string lvldir("/home/"); + passwd *pwd = getpwuid(getuid()); + lvldir.append(pwd->pw_name); + lvldir.append("/.steam/steam/steamapps/common/Team Fortress 2/tf/"); + lvldir.append(lvlname); + lvldir.append(".nav"); + logging::Info(format("Pathing: Nav File location: ", lvldir).c_str()); + + areas.clear(); + navfile = CNavFile(lvldir.c_str()); + if (!navfile.m_isOK) + logging::Info("Pathing: Invalid Nav File"); + else + { + size_t size = navfile.m_areas.size(); + logging::Info( + format("Pathing: Number of areas to index:", size).c_str()); + areas.reserve(size); + for (auto i : navfile.m_areas) + areas.push_back(i); + if (size > 7000) + size = 7000; + TF2MAP = std::make_unique(size); + } + pathfinding = true; +} +std::string lastmap; +bool Prepare() +{ + if (!enabled) + return false; + if (!init) + { + if (lastmap == g_IEngine->GetLevelName()) + { + init = true; + } else { - for (int i = 0; i < navfile.m_areas.size() - 1 + 100; i++) - areas.push_back({}); - for (auto area : navfile.m_areas) - { - nav::singleNode node; - node.pos = area.m_center; - node.id = area.m_id; - areas[node.id] = &node; - if (area.m_hidingSpots.size()) - SniperAreas.push_back(area); + lastmap = g_IEngine->GetLevelName(); + pathfinding = false; + init = true; + Init(); + } + } + if (!pathfinding) + return false; + return true; +} - } - for (auto area : navfile.m_areas) +std::vector localAreas(6); +int findClosestNavSquare(Vector vec) +{ + if (localAreas.size() > 5) + localAreas.erase(localAreas.begin()); + std::vector> overlapping; + for (int i = 0; i < areas.size(); i++) + { + if (areas.at(i).IsOverlapping(vec)) + { + if (std::count(localAreas.begin(), localAreas.end(), i) < 2) + overlapping.push_back({ i, &areas.at(i) }); + } + } + + float bestDist = FLT_MAX; + int bestSquare = -1; + for (int i = 0; i < overlapping.size(); i++) + { + float dist = overlapping.at(i).second->m_center.DistTo(vec); + if (dist < bestDist) + { + bestDist = dist; + bestSquare = overlapping.at(i).first; + } + } + if (bestSquare != -1) + { + if (vec == g_pLocalPlayer->v_Origin) + localAreas.push_back(bestSquare); + return bestSquare; + } + for (int i = 0; i < areas.size(); i++) + { + float dist = areas.at(i).m_center.DistTo(vec); + if (dist < bestDist) + { + if (std::count(localAreas.begin(), localAreas.end(), i) < 2) { - for (auto node : areas) - { - if (area.m_id != node->id) - continue; - for (auto connect : area.m_connections) - node->addChildren(areas[connect.area->m_id]); - } + bestDist = dist; + bestSquare = i; } } } - Timer cd{}; - void CreateMove() + if (vec == g_pLocalPlayer->v_Origin) + localAreas.push_back(bestSquare); + return bestSquare; +} + +std::vector findPath(Vector loc, Vector dest) +{ + if (areas.empty()) + return std::vector(0); + int id_loc = findClosestNavSquare(loc); + int id_dest = findClosestNavSquare(dest); + if (id_loc == -1 || id_dest == -1) + return std::vector(0); + float cost; + micropather::MPVector pathNodes; + int result = TF2MAP->pather->Solve(static_cast(&areas.at(id_loc)), + static_cast(&areas.at(id_dest)), + &pathNodes, &cost); + logging::Info(format(result).c_str()); + if (result == 1) + return std::vector(0); + std::vector path; + for (int i = 0; i < pathNodes.size(); i++) { - if (navfile.m_isOK) + path.push_back(static_cast(pathNodes[i])->m_center); + } + path.push_back(dest); + return path; +} + +static Timer inactivity{}; +static Timer lastJump{}; +static std::vector crumbs; +static bool ensureArrival; + +bool NavTo(Vector dest, bool navToLocalCenter, bool persistent) +{ + if (CE_BAD(LOCAL_E)) + return false; + if (!Prepare()) + return false; + auto path = findPath(g_pLocalPlayer->v_Origin, dest); + if (path.empty()) + return false; + crumbs.clear(); + crumbs = std::move(path); + if (!navToLocalCenter) + crumbs.erase(crumbs.begin()); + inactivity.update(); + ensureArrival = persistent; + return true; +} + +static Vector lastArea = { 0.0f, 0.0f, 0.0f }; +void ignoreConnection() +{ + if (crumbs.size() < 1) + return; + + CNavArea *currnode = nullptr; + for (int i = 0; i < areas.size(); i++) + { + if (areas.at(i).m_center == lastArea) { - if (cd.test_and_set(300)) { - for (auto i : navfile.m_areas) { - Vector vec = LOCAL_E->m_vecOrigin(); - if (i.Contains(vec)) { - LocalNav = i; - break; - } - } - } - if (SniperAreas.size()) { - auto res = areas[LocalNav.m_id]->FindPath(areas[SniperAreas[0].m_id]); - for (auto r : res) - logging::Info("%f, %f, %f", r->pos.x, r->pos.y, r->pos.z); - } + currnode = &areas.at(i); + break; + } + } + if (!currnode) + return; + + CNavArea *nextnode = nullptr; + for (int i = 0; i < areas.size(); i++) + { + if (areas.at(i).m_center == crumbs.at(0)) + { + nextnode = &areas.at(i); + break; + } + } + if (!nextnode) + return; + + for (auto i : currnode->m_connections) + { + if (i.area->m_id == nextnode->m_id) + { + ignoredConnections.push_back({ currnode->m_id, nextnode->m_id }); + TF2MAP->pather->Reset(); + return; } } } + +static Timer ignoreReset{}; +void clearIgnores() +{ + if (ignoreReset.test_and_set(180000)) + { + ignoredConnections.clear(); + if (TF2MAP && TF2MAP->pather) + TF2MAP->pather->Reset(); + } +} + +void CreateMove() +{ + if (!enabled) + return; + if (CE_BAD(LOCAL_E)) + return; + clearIgnores(); + if (crumbs.empty()) + { + ReadyForCommands = true; + ensureArrival = false; + return; + } + ReadyForCommands = false; + if (g_pLocalPlayer->v_Origin.DistTo(crumbs.at(0)) < 30.0f) + { + lastArea = crumbs.at(0); + crumbs.erase(crumbs.begin()); + inactivity.update(); + } + if (crumbs.empty()) + return; + if (crumbs.at(0).z - g_pLocalPlayer->v_Origin.z > 18 && + lastJump.test_and_set(200)) + current_user_cmd->buttons |= IN_JUMP; + if (inactivity.test_and_set(5000)) + { + ignoreConnection(); + if (ensureArrival) + { + logging::Info("Pathing: NavBot inactive for too long. Ignoring " + "connection and finding another path..."); + // NavTo(crumbs.back(), true, true); + crumbs = findPath(g_pLocalPlayer->v_Origin, crumbs.back()); + inactivity.update(); + } + else + { + logging::Info( + "Pathing: NavBot inactive for too long. Canceling tasks and " + "ignoring connection..."); + crumbs.clear(); + } + return; + } + WalkTo(crumbs.at(0)); +} + +CatCommand navinit("nav_init", "Debug nav init", [](const CCommand &args) { + lastmap = ""; + init = false; + Prepare(); +}); + +Vector loc; + +CatCommand navset("nav_set", "Debug nav set", + [](const CCommand &args) { loc = LOCAL_E->m_vecOrigin(); }); +CatCommand navprint("nav_print", "Debug nav print", [](const CCommand &args) { + logging::Info( + format(findClosestNavSquare(g_pLocalPlayer->v_Origin)).c_str()); +}); + +CatCommand navfind("nav_find", "Debug nav find", [](const CCommand &args) { + std::vector path = findPath(g_pLocalPlayer->v_Origin, loc); + if (path.empty()) + { + logging::Info("Pathing: No path found"); + return; + } + std::string output = "Pathing: Path found! Path: "; + for (int i = 0; i < path.size(); i++) + { + output.append(format(path.at(i).x, ",", format(path.at(i).y), " ")); + } + logging::Info(output.c_str()); +}); + +CatCommand navpath("nav_path", "Debug nav path", [](const CCommand &args) { + if (NavTo(loc, true, true)) + { + logging::Info("Pathing: Success! Walking to path..."); + } + else + { + logging::Info("Pathing: Failed!"); + } +}); + +} // namespace nav diff --git a/src/online/Online.cpp b/src/online/Online.cpp old mode 100755 new mode 100644 index 80130bdb..de490928 --- a/src/online/Online.cpp +++ b/src/online/Online.cpp @@ -332,4 +332,4 @@ user_data *getUserData(unsigned steamId) // SteamID does not belong to online user return nullptr; } -} \ No newline at end of file +} // namespace online \ No newline at end of file diff --git a/src/pathfinder.cpp b/src/pathfinder.cpp old mode 100755 new mode 100644 index 6fbc49de..53b62cc3 --- a/src/pathfinder.cpp +++ b/src/pathfinder.cpp @@ -5,13 +5,14 @@ namespace hacks::shared::pathfinder { Vector loc; -//std::vector findPath(Vector loc, Vector dest); -//bool initiatenavfile(); +// std::vector findPath(Vector loc, Vector dest); +// bool initiatenavfile(); -//CatCommand navset("nav_set", "Debug nav set", -// [](const CCommand &args) { loc = g_pLocalPlayer->v_Origin; }); +// CatCommand navset("nav_set", "Debug nav set", +// [](const CCommand &args) { loc = g_pLocalPlayer->v_Origin; +// }); -//CatCommand navfind("nav_find", "Debug nav find", [](const CCommand &args) { +// CatCommand navfind("nav_find", "Debug nav find", [](const CCommand &args) { // std::vector path = findPath(g_pLocalPlayer->v_Origin, loc); // if (path.empty()) // { @@ -25,28 +26,28 @@ Vector loc; // logging::Info(output.c_str()); //}); -//CatCommand navinit("nav_init", "Debug nav init", +// CatCommand navinit("nav_init", "Debug nav init", // [](const CCommand &args) { initiatenavfile(); }); class navNode : public AStarNode { -// navNode() -// { -// } + // navNode() + // { + // } -// ~navNode() -// { -// } + // ~navNode() + // { + // } public: Vector vecLoc; }; std::vector nodes; -//settings::Bool enabled{ "pathing.enabled", 0 }; +// settings::Bool enabled{ "pathing.enabled", 0 }; bool initiatenavfile() { - //if (!enabled) + // if (!enabled) // return false; logging::Info("Pathing: Initiating path..."); @@ -118,11 +119,11 @@ std::vector findPath(Vector loc, Vector dest) int id_loc = findClosestNavSquare(loc); int id_dest = findClosestNavSquare(dest); - navNode &node_loc = *nodes.at(id_loc); + navNode &node_loc = *nodes.at(id_loc); navNode &node_dest = *nodes.at(id_dest); PathFinder p; - std::vector pathNodes; + std::vector pathNodes; p.setStart(node_loc); p.setGoal(node_dest); @@ -135,4 +136,5 @@ std::vector findPath(Vector loc, Vector dest) path.push_back(pathNodes.at(i)->vecLoc); } return path; -}} +} +} // namespace hacks::shared::pathfinder diff --git a/src/playerlist.cpp b/src/playerlist.cpp old mode 100755 new mode 100644 index 88668741..00211ed8 --- a/src/playerlist.cpp +++ b/src/playerlist.cpp @@ -180,7 +180,7 @@ CatCommand pl_set_state( k_EState state = static_cast(strtol(args.Arg(2), nullptr, 10)); if (state < k_EState::DEFAULT || state > k_EState::STATE_LAST) - state = k_EState::DEFAULT; + state = k_EState::DEFAULT; AccessData(steamid).state = state; logging::Info("Set %d to %d", steamid, state); }); @@ -216,4 +216,4 @@ CatCommand pl_info("pl_info", "pl_info uniqueid", [](const CCommand &args) { ConColorMsg(*reinterpret_cast<::Color*>(&clr), "[CUSTOM COLOR]\n"); }*/ }); -} +} // namespace playerlist diff --git a/src/prediction.cpp b/src/prediction.cpp old mode 100755 new mode 100644 index 3e5f0f87..100ead10 --- a/src/prediction.cpp +++ b/src/prediction.cpp @@ -75,7 +75,7 @@ void Prediction_CreateMove() ent->m_vecOrigin() = r; predicted_players[i].push_back(std::move(r)); } - ent->m_vecOrigin() = o; + ent->m_vecOrigin() = o; CE_VECTOR(ent, 0x354) = o; // logging::Info("Predicted %d to be at [%.2f, %.2f, %.2f] vs [%.2f, // %.2f, %.2f]", i, r.x,r.y,r.z, o.x, o.y, o.z); @@ -149,7 +149,7 @@ Vector EnginePrediction(CachedEntity *entity, float time) if (velocity::EstimateAbsVelocity) velocity::EstimateAbsVelocity(RAW_ENT(entity), vel); else - vel = CE_VECTOR(entity, netvar.vVelocity); + vel = CE_VECTOR(entity, netvar.vVelocity); fakecmd.command_number = last_cmd_number; fakecmd.forwardmove = vel.x; fakecmd.sidemove = -vel.y; @@ -165,7 +165,7 @@ Vector EnginePrediction(CachedEntity *entity, float time) g_GlobalVars->interval_per_tick * NET_INT(ent, netvar.nTickBase); g_GlobalVars->frametime = time; - Vector old_origin = entity->m_vecOrigin(); + Vector old_origin = entity->m_vecOrigin(); NET_VECTOR(ent, 0x354) = entity->m_vecOrigin(); //*g_PredictionRandomSeed = @@ -187,7 +187,7 @@ Vector EnginePrediction(CachedEntity *entity, float time) g_GlobalVars->frametime = frameTime; g_GlobalVars->curtime = curTime; - result = ent->GetAbsOrigin(); + result = ent->GetAbsOrigin(); NET_VECTOR(ent, 0x354) = old_origin; CE_VECTOR(entity, netvar.m_angEyeAngles) = oldangles; return result; @@ -215,12 +215,12 @@ Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed, float currenttime = medianTime - range; if (currenttime <= 0.0f) currenttime = 0.01f; - float besttime = currenttime; - float mindelta = 65536.0f; - Vector bestpos = origin; - Vector current = origin; - int maxsteps = 40; - bool onground = false; + float besttime = currenttime; + float mindelta = 65536.0f; + Vector bestpos = origin; + Vector current = origin; + int maxsteps = 40; + bool onground = false; if (ent->m_Type() == ENTITY_PLAYER) { if (CE_INT(ent, netvar.iFlags) & FL_ONGROUND) @@ -246,7 +246,7 @@ Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed, mindelta = fabs(rockettime - currenttime); } } - ent->m_vecOrigin() = origin; + ent->m_vecOrigin() = origin; CE_VECTOR(ent, 0x354) = origin; bestpos.z += (400 * besttime * besttime * gravitymod); // S = at^2/2 ; t = sqrt(2S/a)*/ @@ -286,10 +286,10 @@ Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed, float currenttime = medianTime - range; if (currenttime <= 0.0f) currenttime = 0.01f; - float besttime = currenttime; - float mindelta = 65536.0f; - Vector bestpos = result; - int maxsteps = 300; + float besttime = currenttime; + float mindelta = 65536.0f; + Vector bestpos = result; + int maxsteps = 300; for (int steps = 0; steps < maxsteps; steps++, currenttime += ((float) (2 * range) / (float) maxsteps)) { diff --git a/src/projlogging.cpp b/src/projlogging.cpp old mode 100755 new mode 100644 index d66c1acf..4f213533 --- a/src/projlogging.cpp +++ b/src/projlogging.cpp @@ -43,4 +43,4 @@ void Update() } } } -} +} // namespace projectile_logging diff --git a/src/sconvars.cpp b/src/sconvars.cpp old mode 100755 new mode 100644 index 9dc8a634..9f66b31b --- a/src/sconvars.cpp +++ b/src/sconvars.cpp @@ -43,4 +43,4 @@ CatCommand spoof_convar("spoof", "Spoof ConVar", [](const CCommand &args) { } convars.push_back(new SpoofedConVar(var)); }); -} +} // namespace sconvar diff --git a/src/sdk/KeyValues.cpp b/src/sdk/KeyValues.cpp old mode 100755 new mode 100644 index b6b0c4e4..079a4bb1 --- a/src/sdk/KeyValues.cpp +++ b/src/sdk/KeyValues.cpp @@ -721,9 +721,8 @@ bool KeyValues::LoadFromFile(IBaseFileSystem *filesystem, resourceName ? resourceName : ""); // Keep a cache of keyvalues, try to load it here. - if (bUseCacheForRead && - KeyValuesSystem()->LoadFileKeyValuesFromCache(this, resourceName, - pathID, filesystem)) + if (bUseCacheForRead && KeyValuesSystem()->LoadFileKeyValuesFromCache( + this, resourceName, pathID, filesystem)) { COM_TimestampedLog("KeyValues::LoadFromFile(%s%s%s): End / CacheHit", pathID ? pathID : "", @@ -799,8 +798,9 @@ bool KeyValues::SaveToFile(IBaseFileSystem *filesystem, if (f == FILESYSTEM_INVALID_HANDLE) { - DevMsg(1, "KeyValues::SaveToFile: couldn't open file \"%s\" in path " - "\"%s\".\n", + DevMsg(1, + "KeyValues::SaveToFile: couldn't open file \"%s\" in path " + "\"%s\".\n", resourceName ? resourceName : "NULL", pathID ? pathID : "NULL"); return false; } @@ -2998,8 +2998,9 @@ void KeyValues::UnpackIntoStructure( Assert(dest_field + pUnpackTable->m_nFieldSize < pDestEnd); char *dest_s = (char *) dest_field; - strncpy(dest_s, GetString(pUnpackTable->m_pKeyName, - pUnpackTable->m_pKeyDefault), + strncpy(dest_s, + GetString(pUnpackTable->m_pKeyName, + pUnpackTable->m_pKeyDefault), pUnpackTable->m_nFieldSize); } break; @@ -3012,7 +3013,7 @@ void KeyValues::UnpackIntoStructure( int default_int = 0; if (pUnpackTable->m_pKeyDefault) default_int = atoi(pUnpackTable->m_pKeyDefault); - *(dest_i) = GetInt(pUnpackTable->m_pKeyName, default_int); + *(dest_i) = GetInt(pUnpackTable->m_pKeyName, default_int); } break; diff --git a/src/sdk/netmessage.cpp b/src/sdk/netmessage.cpp old mode 100755 new mode 100644 index 09873729..15c6bf2b --- a/src/sdk/netmessage.cpp +++ b/src/sdk/netmessage.cpp @@ -56,7 +56,7 @@ public: for (unsigned int maskBit = 0; maskBit < 32; maskBit++) g_ExtraMasks[maskBit] = BitForBitnum(maskBit) - 1; - g_ExtraMasks[32] = ~0ul; + g_ExtraMasks[32] = ~0ul; for (unsigned int littleBit = 0; littleBit < 32; littleBit++) StoreLittleDWord(&g_LittleBits[littleBit], 0, 1u << littleBit); diff --git a/src/sdk/utlbuffer.cpp b/src/sdk/utlbuffer.cpp old mode 100755 new mode 100644 index de188e0f..b46151a6 --- a/src/sdk/utlbuffer.cpp +++ b/src/sdk/utlbuffer.cpp @@ -177,9 +177,8 @@ char CUtlCharConversion::FindConversion(const char *pString, int *pLength) { for (int i = 0; i < m_nCount; ++i) { - if (!Q_strcmp(pString, - m_pReplacements[(unsigned char) m_pList[i]] - .m_pReplacementString)) + if (!Q_strcmp(pString, m_pReplacements[(unsigned char) m_pList[i]] + .m_pReplacementString)) { *pLength = m_pReplacements[(unsigned char) m_pList[i]].m_nLength; return m_pList[i]; diff --git a/src/settings/Manager.cpp b/src/settings/Manager.cpp old mode 100755 new mode 100644 index 34c9fb92..67226c84 --- a/src/settings/Manager.cpp +++ b/src/settings/Manager.cpp @@ -41,4 +41,4 @@ bool Manager::VariableDescriptor::isChanged() { return variable.toString() != defaults; } -} \ No newline at end of file +} // namespace settings \ No newline at end of file diff --git a/src/tfmm.cpp b/src/tfmm.cpp old mode 100755 new mode 100644 index 2cad87e6..c4f9deb4 --- a/src/tfmm.cpp +++ b/src/tfmm.cpp @@ -86,4 +86,4 @@ void abandon() else logging::Info("abandon: CTFGCClientSystem == null!"); } -} +} // namespace tfmm diff --git a/src/velocity.cpp b/src/velocity.cpp old mode 100755 new mode 100644 index 23f4bd08..9742dcf3 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -25,4 +25,4 @@ void Init() "08 E8 ? ? ? ? 0F B6 45 EC F3 0F 10 45 F0 F3 0F 11 05 ? ? ? ? A2 ? " "? ? ? 8B 45 E8 A3 ? ? ? ? 83 C4 20 5B 5E 5D C3"); } -} +} // namespace velocity diff --git a/src/visual/EffectChams.cpp b/src/visual/EffectChams.cpp old mode 100755 new mode 100644 index 75dcace7..7b5aeac6 --- a/src/visual/EffectChams.cpp +++ b/src/visual/EffectChams.cpp @@ -336,4 +336,4 @@ void EffectChams::Render(int x, int y, int w, int h) EffectChams g_EffectChams; CScreenSpaceEffectRegistration *g_pEffectChams = nullptr; -} +} // namespace effect_chams diff --git a/src/visual/EffectGlow.cpp b/src/visual/EffectGlow.cpp old mode 100755 new mode 100644 index 988b4300..4793aad7 --- a/src/visual/EffectGlow.cpp +++ b/src/visual/EffectGlow.cpp @@ -95,7 +95,7 @@ ITexture *GetBuffer(int i) { ITexture *fullframe; IF_GAME(IsTF2()) - fullframe = g_IMaterialSystem->FindTexture("_rt_FullFrameFB", + fullframe = g_IMaterialSystem->FindTexture("_rt_FullFrameFB", TEXTURE_GROUP_RENDER_TARGET); else fullframe = g_IMaterialSystemHL->FindTexture( "_rt_FullFrameFB", TEXTURE_GROUP_RENDER_TARGET); @@ -488,4 +488,4 @@ void EffectGlow::Render(int x, int y, int w, int h) EffectGlow g_EffectGlow; CScreenSpaceEffectRegistration *g_pEffectGlow = nullptr; -} +} // namespace effect_glow diff --git a/src/visual/SDLHooks.cpp b/src/visual/SDLHooks.cpp old mode 100755 new mode 100644 index 8b8d3ca4..d8899598 --- a/src/visual/SDLHooks.cpp +++ b/src/visual/SDLHooks.cpp @@ -15,7 +15,7 @@ namespace pointers { hooked_methods::types::SDL_GL_SwapWindow *SDL_GL_SwapWindow{ nullptr }; hooked_methods::types::SDL_PollEvent *SDL_PollEvent{ nullptr }; -} +} // namespace pointers void applySdlHooks() { @@ -38,4 +38,4 @@ void cleanSdlHooks() { *pointers::SDL_GL_SwapWindow = hooked_methods::original::SDL_GL_SwapWindow; } -} \ No newline at end of file +} // namespace sdl_hooks \ No newline at end of file diff --git a/src/visual/atlas.cpp b/src/visual/atlas.cpp old mode 100755 new mode 100644 index 679367d2..7a6f3b10 --- a/src/visual/atlas.cpp +++ b/src/visual/atlas.cpp @@ -37,4 +37,4 @@ texture_atlas &atlas() static texture_atlas object{ DATA_PATH "/textures/atlas.png", 1024, 512 }; return object; } -} +} // namespace textures diff --git a/src/visual/drawing.cpp b/src/visual/drawing.cpp old mode 100755 new mode 100644 index 1044b512..c7f506dc --- a/src/visual/drawing.cpp +++ b/src/visual/drawing.cpp @@ -82,7 +82,7 @@ namespace fonts std::unique_ptr menu{ nullptr }; std::unique_ptr esp{ nullptr }; -} +} // namespace fonts void draw::Initialize() { @@ -126,15 +126,17 @@ bool draw::WorldToScreen(const Vector &origin, Vector &screen) { odw = 1.0f / w; screen.x = (draw::width / 2) + - (0.5 * ((wts[0][0] * origin[0] + wts[0][1] * origin[1] + - wts[0][2] * origin[2] + wts[0][3]) * - odw) * + (0.5 * + ((wts[0][0] * origin[0] + wts[0][1] * origin[1] + + wts[0][2] * origin[2] + wts[0][3]) * + odw) * draw::width + 0.5); screen.y = (draw::height / 2) - - (0.5 * ((wts[1][0] * origin[0] + wts[1][1] * origin[1] + - wts[1][2] * origin[2] + wts[1][3]) * - odw) * + (0.5 * + ((wts[1][0] * origin[0] + wts[1][1] * origin[1] + + wts[1][2] * origin[2] + wts[1][3]) * + odw) * draw::height + 0.5); return true; diff --git a/src/visual/drawmgr.cpp b/src/visual/drawmgr.cpp old mode 100755 new mode 100644 index 222d4925..e8f2a162 --- a/src/visual/drawmgr.cpp +++ b/src/visual/drawmgr.cpp @@ -83,7 +83,7 @@ void DrawCheatVisuals() || g_pGUI->Visible() */ #endif - ) + ) { // FIXME /*name_s = *force_name; diff --git a/src/visual/fidgetspinner.cpp b/src/visual/fidgetspinner.cpp old mode 100755 new mode 100644 index b0d8075b..6ebeeca7 --- a/src/visual/fidgetspinner.cpp +++ b/src/visual/fidgetspinner.cpp @@ -77,7 +77,7 @@ void DrawSpinner() spinning_speed = float(spinner_min_speed); if (spinning_speed > 1000) spinning_speed = 1000; - float real_speed = 0; + float real_speed = 0; const float speed_cap(spinner_speed_cap); if (spinning_speed < 250) real_speed = speed_cap * (spinning_speed / 250.0f); diff --git a/src/visual/menu/menu/BaseMenuObject.cpp b/src/visual/menu/menu/BaseMenuObject.cpp old mode 100755 new mode 100644 index 5c6dc962..3a440092 --- a/src/visual/menu/menu/BaseMenuObject.cpp +++ b/src/visual/menu/menu/BaseMenuObject.cpp @@ -325,4 +325,4 @@ bool BaseMenuObject::onLeftMouseClick() emit(msg, false); return false; } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/KeyValue.cpp b/src/visual/menu/menu/KeyValue.cpp old mode 100755 new mode 100644 index 06d69f41..44986257 --- a/src/visual/menu/menu/KeyValue.cpp +++ b/src/visual/menu/menu/KeyValue.cpp @@ -69,4 +69,4 @@ KeyValue::Value &KeyValue::operator[](const std::string &key) KeyValue::KeyValue(std::string name) : name{ std::move(name) } { } -} +} // namespace zerokernel diff --git a/src/visual/menu/menu/Menu.cpp b/src/visual/menu/menu/Menu.cpp old mode 100755 new mode 100644 index 680d31d3..3d502df5 --- a/src/visual/menu/menu/Menu.cpp +++ b/src/visual/menu/menu/Menu.cpp @@ -81,7 +81,7 @@ namespace resource::font // FIXME dynamic font change.. glez::font base{ DATA_PATH "/menu/Verdana.ttf", 10 }; glez::font bold{ DATA_PATH "/menu/VerdanaBold.ttf", 9 }; -} +} // namespace resource::font namespace style::colors { @@ -90,7 +90,7 @@ color_type text{ "zk.style.menu.color.text", "c4d3e1" }; color_type text_shadow{ "zk.style.menu.color.text_shadow", "000000" }; color_type error{ "zk.style.menu.color.error", "ff0000" }; -} +} // namespace style::colors Menu::Menu(int w, int h) : tooltip{}, wm{ nullptr } { @@ -289,4 +289,4 @@ void Menu::loadFromFile(std::string directory, std::string path) recursiveXmlResolveIncludes(directory, xml_source.RootElement()); loadFromXml(xml_source.RootElement()); } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/Message.cpp b/src/visual/menu/menu/Message.cpp old mode 100755 new mode 100644 index 269b659a..8e2bee01 --- a/src/visual/menu/menu/Message.cpp +++ b/src/visual/menu/menu/Message.cpp @@ -10,4 +10,4 @@ namespace zerokernel Message::Message(std::string name) : name(name), kv(std::move(name)) { } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/ObjectFactory.cpp b/src/visual/menu/menu/ObjectFactory.cpp old mode 100755 new mode 100644 index 3ffe5fc2..cf8ede92 --- a/src/visual/menu/menu/ObjectFactory.cpp +++ b/src/visual/menu/menu/ObjectFactory.cpp @@ -232,4 +232,4 @@ ObjectFactory::createFromPrefab(const std::string &prefab_name) return createObjectFromXml(prefab->FirstChildElement()); return nullptr; } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/Utility.cpp b/src/visual/menu/menu/Utility.cpp old mode 100755 new mode 100644 index 1b2bdd88..54e4bab5 --- a/src/visual/menu/menu/Utility.cpp +++ b/src/visual/menu/menu/Utility.cpp @@ -40,7 +40,7 @@ std::string wrapString(const std::string &input, glez::font &font, int width, lineCount++; if (lineWidth > maxWidth) maxWidth = lineWidth; - lineWidth = 0; + lineWidth = 0; } if (lineWidth) resultStream << ' '; @@ -62,7 +62,7 @@ std::string wrapString(const std::string &input, glez::font &font, int width, lineCount++; if (lineWidth > maxWidth) maxWidth = lineWidth; - lineWidth = 0; + lineWidth = 0; } else wordStream << c; @@ -124,4 +124,4 @@ void drawCenteredString(int x, int y, const std::string &string, *zerokernel::style::colors::text_shadow, nullptr, nullptr); } -} \ No newline at end of file +} // namespace utility \ No newline at end of file diff --git a/src/visual/menu/menu/objects/TabButton.cpp b/src/visual/menu/menu/objects/TabButton.cpp old mode 100755 new mode 100644 index 4e175592..d08c052a --- a/src/visual/menu/menu/objects/TabButton.cpp +++ b/src/visual/menu/menu/objects/TabButton.cpp @@ -96,4 +96,4 @@ void TabButton::recursiveSizeUpdate() text.recursiveSizeUpdate(); } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/Tooltip.cpp b/src/visual/menu/menu/objects/Tooltip.cpp old mode 100755 new mode 100644 index df132716..df71af33 --- a/src/visual/menu/menu/objects/Tooltip.cpp +++ b/src/visual/menu/menu/objects/Tooltip.cpp @@ -55,4 +55,4 @@ void Tooltip::onMove() text.onParentMove(); } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/container/Container.cpp b/src/visual/menu/menu/objects/container/Container.cpp old mode 100755 new mode 100644 index 6d2b0ee6..e52dd336 --- a/src/visual/menu/menu/objects/container/Container.cpp +++ b/src/visual/menu/menu/objects/container/Container.cpp @@ -184,4 +184,4 @@ void Container::renderDebugOverlay() o->renderDebugOverlay(); } } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/container/ModalColorSelect.cpp b/src/visual/menu/menu/objects/container/ModalColorSelect.cpp old mode 100755 new mode 100644 index 5c03cd54..93450a31 --- a/src/visual/menu/menu/objects/container/ModalColorSelect.cpp +++ b/src/visual/menu/menu/objects/container/ModalColorSelect.cpp @@ -108,4 +108,4 @@ void ModalColorSelect::handleMessage(Message &msg, bool is_relayed) BaseMenuObject::handleMessage(msg, is_relayed); } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/container/TabContainer.cpp b/src/visual/menu/menu/objects/container/TabContainer.cpp old mode 100755 new mode 100644 index ef9082b6..c944f037 --- a/src/visual/menu/menu/objects/container/TabContainer.cpp +++ b/src/visual/menu/menu/objects/container/TabContainer.cpp @@ -163,4 +163,4 @@ Container *TabContainer::getActiveContainer() } return containers.at(selection.active).get(); } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/container/TabSelection.cpp b/src/visual/menu/menu/objects/container/TabSelection.cpp old mode 100755 new mode 100644 index 298c86ac..464cb902 --- a/src/visual/menu/menu/objects/container/TabSelection.cpp +++ b/src/visual/menu/menu/objects/container/TabSelection.cpp @@ -51,4 +51,4 @@ void TabSelection::reorderElements() acc += o->getBoundingBox().getFullBox().width; } } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/input/ColorSelector.cpp b/src/visual/menu/menu/objects/input/ColorSelector.cpp old mode 100755 new mode 100644 index b130b9ce..c7c4bd37 --- a/src/visual/menu/menu/objects/input/ColorSelector.cpp +++ b/src/visual/menu/menu/objects/input/ColorSelector.cpp @@ -69,4 +69,4 @@ void ColorSelector::loadFromXml(const tinyxml2::XMLElement *data) } } } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/objects/input/Slider.cpp b/src/visual/menu/menu/objects/input/Slider.cpp old mode 100755 new mode 100644 index a08aa936..54d53d8d --- a/src/visual/menu/menu/objects/input/Slider.cpp +++ b/src/visual/menu/menu/objects/input/Slider.cpp @@ -31,4 +31,4 @@ settings::RVariable SliderStyle::handle_border{ settings::RVariable SliderStyle::bar_color{ "zk.style.input.slider.color.bar", "079797" }; -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/visual/menu/menu/wm/WMWindow.cpp b/src/visual/menu/menu/wm/WMWindow.cpp old mode 100755 new mode 100644 index ecee2452..3e181dce --- a/src/visual/menu/menu/wm/WMWindow.cpp +++ b/src/visual/menu/menu/wm/WMWindow.cpp @@ -197,4 +197,4 @@ bool WMWindow::isFocused() { return focused && !Menu::instance->isInGame(); } -} \ No newline at end of file +} // namespace zerokernel \ No newline at end of file diff --git a/src/votelogger.cpp b/src/votelogger.cpp old mode 100755 new mode 100644 index 4a689324..a4f26fdd --- a/src/votelogger.cpp +++ b/src/votelogger.cpp @@ -65,4 +65,4 @@ void dispatchUserMessage(bf_read &buffer, int type) break; } } -} +} // namespace votelogger