Fixed player getting ejected from nightclub while holding weapon. (#2447)

* Fixed nightclub ejecting the player if they had weapons equipped with Allow Weapons in Interiors on.
* Fix jittering weapons in the freakshop.
* Added all carmod shop scripts to prevent jittering in interiors.
This commit is contained in:
gir489 2023-11-24 15:34:33 -05:00 committed by GitHub
parent a5fb18c06b
commit 522fd3bac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 1 deletions

View File

@ -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<PBOOL>(-298441869))
{
*tunable = FALSE;
}
}
virtual void on_disable() override
{
if (auto tunable = g_tunables_service->get_tunable<PBOOL>(-298441869))
{
*tunable = TRUE;
}
}
};
allow_weapons_in_interiors g_allow_weaps_inside("allowwepsinside", "VIEW_WEAPON_ALLOW_WEAPONS_IN_INTERIORS", "", g.weapons.interior_weapon);
}

View File

@ -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);

View File

@ -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();