diff --git a/src/backend/looped/tunables/allow_weapons_in_interiors.cpp b/src/backend/looped/tunables/allow_weapons_in_interiors.cpp new file mode 100644 index 00000000..31cbb993 --- /dev/null +++ b/src/backend/looped/tunables/allow_weapons_in_interiors.cpp @@ -0,0 +1,28 @@ +#include "backend/looped_command.hpp" +#include "services/tunables/tunables_service.hpp" + +namespace big +{ + class allow_weapons_in_interiors : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + if (auto tunable = g_tunables_service->get_tunable(-298441869)) + { + *tunable = FALSE; + } + } + + virtual void on_disable() override + { + if (auto tunable = g_tunables_service->get_tunable(-298441869)) + { + *tunable = TRUE; + } + } + }; + + allow_weapons_in_interiors g_allow_weaps_inside("allowwepsinside", "VIEW_WEAPON_ALLOW_WEAPONS_IN_INTERIORS", "", g.weapons.interior_weapon); +} diff --git a/src/native_hooks/native_hooks.cpp b/src/native_hooks/native_hooks.cpp index 9c497d99..c7678579 100644 --- a/src/native_hooks/native_hooks.cpp +++ b/src/native_hooks/native_hooks.cpp @@ -166,6 +166,19 @@ namespace big add_native_detour(RAGE_JOAAT("tuneables_processing"), 0x697F508861875B42, tunables::NETWORK_ACCESS_TUNABLE_BOOL_MODIFICATION_DETECTION_REGISTRATION_HASH); add_native_detour(RAGE_JOAAT("tuneables_processing"), 0x972BC203BBC4C4D5, tunables::NETWORK_ACCESS_TUNABLE_FLOAT_HASH); + add_native_detour(RAGE_JOAAT("arena_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("armory_aircraft_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("base_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("business_hub_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("car_meet_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("carmod_shop"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("fixer_hq_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("hacker_truck_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("hangar_carmod_shop"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("juggalo_hideout_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("personal_carmod_shop"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + add_native_detour(RAGE_JOAAT("tuner_property_carmod"), 0x2208438012482A1A, all_scripts::DO_NOTHING); //Fix jittering weapons. + for (auto& entry : *g_pointers->m_gta.m_script_program_table) if (entry.m_program) hook_program(entry.m_program); diff --git a/src/views/self/view_weapons.cpp b/src/views/self/view_weapons.cpp index 7fbab04d..51e8c767 100644 --- a/src/views/self/view_weapons.cpp +++ b/src/views/self/view_weapons.cpp @@ -39,7 +39,7 @@ namespace big components::command_checkbox<"alwaysfullammo">(); components::command_checkbox<"infclip">(); components::command_checkbox<"infrange">(); - ImGui::Checkbox("VIEW_WEAPON_ALLOW_WEAPONS_IN_INTERIORS"_T.data(), &g.weapons.interior_weapon); + components::command_checkbox<"allowwepsinside">(); ImGui::EndGroup(); ImGui::SameLine();