mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 06:47:22 +08:00
* Reduces natives called in hotkey_service::wndproc to prevent collisions. * Removed debug code from carmod_shop::STAT_GET_INT * Fixed #2152. * Added sanity check to script thread in hotkey_service::wndproc. Made is_mp_chat_active atomic to ensure cache coherence. * Closes #2164
This commit is contained in:
parent
25a2d2b32e
commit
bc36de5d2f
@ -10,5 +10,6 @@ namespace big
|
||||
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
|
||||
g.self.hud.typing--;
|
||||
}
|
||||
g.settings.hotkeys.is_mp_chat_active = HUD::IS_MP_TEXT_CHAT_TYPING();
|
||||
}
|
||||
}
|
@ -435,6 +435,7 @@ namespace big
|
||||
struct hotkeys
|
||||
{
|
||||
bool editing_menu_toggle = false;
|
||||
std::atomic<bool> is_mp_chat_active;
|
||||
int menu_toggle = VK_INSERT;
|
||||
int teleport_waypoint = 0;
|
||||
int teleport_objective = 0;
|
||||
|
@ -144,6 +144,18 @@ namespace big
|
||||
NETWORK::NETWORK_OVERRIDE_CLOCK_TIME(src->get_arg<int>(0), src->get_arg<int>(1), src->get_arg<int>(2));
|
||||
}
|
||||
|
||||
void SET_ENTITY_HEALTH(rage::scrNativeCallContext* src)
|
||||
{
|
||||
Entity entity = src->get_arg<int>(0);
|
||||
int health = src->get_arg<int>(1);
|
||||
int p2 = src->get_arg<int>(2);
|
||||
|
||||
if (g.self.god_mode && entity == self::ped)
|
||||
health = ENTITY::GET_ENTITY_MAX_HEALTH(entity);
|
||||
|
||||
ENTITY::SET_ENTITY_HEALTH(entity, health, p2);
|
||||
}
|
||||
|
||||
void RETURN_TRUE(rage::scrNativeCallContext* src)
|
||||
{
|
||||
src->set_return_value<BOOL>(TRUE);
|
||||
|
@ -46,9 +46,6 @@ namespace big
|
||||
case RAGE_JOAAT("MP1_AWD_FMRALLYWONNAV"):
|
||||
case RAGE_JOAAT("MP1_AWD_FMWINSEARACE"):
|
||||
case RAGE_JOAAT("MP1_AWD_FMWINAIRRACE"): *out = 1; break;
|
||||
case RAGE_JOAAT("SP0_TOTAL_CASH"):
|
||||
case RAGE_JOAAT("SP1_TOTAL_CASH"):
|
||||
case RAGE_JOAAT("SP2_TOTAL_CASH"): *out = 999999; break;
|
||||
default: src->set_return_value<BOOL>(STATS::STAT_GET_INT(hash, out, src->get_arg<int>(2))); break;
|
||||
}
|
||||
}
|
||||
|
@ -114,6 +114,7 @@ namespace big
|
||||
add_native_detour(0xEB354E5376BC81A7, all_scripts::HUD_FORCE_WEAPON_WHEEL);
|
||||
add_native_detour(0x158C16F5E4CF41F8, all_scripts::RETURN_TRUE); // bypass casino country restrictions
|
||||
add_native_detour(0xE679E3E06E363892, all_scripts::NETWORK_OVERRIDE_CLOCK_TIME);
|
||||
add_native_detour(0x6B76DC1F3AE6E6A3, all_scripts::SET_ENTITY_HEALTH);
|
||||
add_native_detour(0x40EB1EFD921822BC, all_scripts::DO_NOTHING); // SECURITY::REGISTER_SCRIPT_VARIABLE
|
||||
add_native_detour(0x340A36A700E99699, all_scripts::DO_NOTHING); // SECURITY::UNREGISTER_SCRIPT_VARIABLE
|
||||
add_native_detour(0x8E580AB902917360, all_scripts::DO_NOTHING); // SECURITY::FORCE_CHECK_SCRIPT_VARIABLES
|
||||
|
@ -88,7 +88,17 @@ namespace big
|
||||
if (g.cmd_executor.enabled)
|
||||
return;
|
||||
|
||||
if (g_gui->is_open() || *g_pointers->m_gta.m_is_social_club_overlay_active || SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("cellphone_flashhand")) > 0 || HUD::IS_MP_TEXT_CHAT_TYPING())
|
||||
bool is_using_cellphone = false;
|
||||
for (auto script : *g_pointers->m_gta.m_script_threads)
|
||||
{
|
||||
if (script && script->m_script_hash == RAGE_JOAAT("cellphone_flashhand"))
|
||||
{
|
||||
is_using_cellphone = script->m_context.m_state == rage::eThreadState::running;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_gui->is_open() || *g_pointers->m_gta.m_is_social_club_overlay_active || is_using_cellphone
|
||||
|| g.settings.hotkeys.is_mp_chat_active)
|
||||
return;
|
||||
|
||||
if (state == eKeyState::RELEASE || state == eKeyState::DOWN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user