From 9c67ec49f126a3af6980dcfe8ad6de1bfb55499b Mon Sep 17 00:00:00 2001 From: lzwdgc Date: Thu, 4 Apr 2024 23:50:53 +0300 Subject: [PATCH] [mod] Misc. --- .../mods/aim1_community_fix/aim.exe.fixes.h | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/examples/mods/aim1_community_fix/aim.exe.fixes.h b/examples/mods/aim1_community_fix/aim.exe.fixes.h index 0dd7cb2..e873e99 100644 --- a/examples/mods/aim1_community_fix/aim.exe.fixes.h +++ b/examples/mods/aim1_community_fix/aim.exe.fixes.h @@ -4,6 +4,8 @@ #pragma optimize("", off) #endif +constexpr auto call_command_length = 5; + // public enums enum aim1_fix : uint32_t { script_function__ISGLIDER = 0x0043A1F6, @@ -17,7 +19,6 @@ enum aim1_fix : uint32_t { }; // set different size if your injection takes more than default 5 bytes uint32_t get_injection_size(uint32_t key) { - constexpr auto call_command_length = 5; switch (key) { case aim1_fix::script_function__ISGLIDER: return 10; case aim1_fix::can_leave_trade_window: return 6; @@ -40,8 +41,6 @@ uint32_t get_injection_size(uint32_t key) { using namespace std::literals; -constexpr auto call_command_length = 5; - uint32_t known_caller; auto player_ptr = (Player **)0x005B7B38; auto get_player_ptr() { @@ -121,22 +120,22 @@ bool is_double_light_weapons_glider(int id) { || get_glider_name(id) == "GL_S3_PS_FINDER1"sv ; } -bool is_double_heavy_weapons_glider(int id) { - return false - || get_glider_name(id) == "GL_M3_PA_EYEDSTONE"sv - || get_glider_name(id) == "GL_S3_PS_FINDER2"sv - ; -} -bool is_special_glider(int id) { - return is_double_light_weapons_glider(id) || is_double_heavy_weapons_glider(id); -} - bool is_double_light_weapons_glider() { return is_double_light_weapons_glider(get_player_ptr()->glider_name.idx); } +bool is_double_heavy_weapons_glider(int id) { + return false + || get_glider_name(id) == "GL_M3_PA_EYEDSTONE"sv + //|| get_glider_name(id) == "GL_M3_PA_EYESTONE"sv + || get_glider_name(id) == "GL_S3_PS_FINDER2"sv + ; +} bool is_double_heavy_weapons_glider() { return is_double_heavy_weapons_glider(get_player_ptr()->glider_name.idx); } +bool is_special_glider(int id) { + return is_double_light_weapons_glider(id) || is_double_heavy_weapons_glider(id); +} bool is_special_glider() { return is_double_light_weapons_glider() || is_double_heavy_weapons_glider(); }