Fix gamepad related crash

This commit is contained in:
Federico Cecchetto 2022-06-25 03:05:42 +02:00
parent 6336232fde
commit e198af0d6d

View File

@ -169,6 +169,15 @@ namespace patches
{ {
return 1; return 1;
} }
utils::hook::detour cl_gamepad_scrolling_buttons_hook;
void cl_gamepad_scrolling_buttons_stub(int local_client_num, int a2)
{
if (local_client_num <= 3)
{
cl_gamepad_scrolling_buttons_hook.invoke<void>(local_client_num, a2);
}
}
} }
class component final : public component_interface class component final : public component_interface
@ -302,6 +311,9 @@ namespace patches
// Dont free server/client memory on asset loading (fixes crashing on map rotation) // Dont free server/client memory on asset loading (fixes crashing on map rotation)
utils::hook::nop(0x132474_b, 5); utils::hook::nop(0x132474_b, 5);
// Fix gamepad related crash
cl_gamepad_scrolling_buttons_hook.create(0x133210_b, cl_gamepad_scrolling_buttons_stub);
} }
}; };
} }