dont check for how many controllers just attempt to reset "all"

JoyInfo->dev will be null
The crash before was most likely due to an oob read
This commit is contained in:
Alug committed 2025-05-10 21:37:16 +02:00
1 parent b8839896c6
commit 6bfb448de1
2 files changed
+3 -4

No files matched your search

+1 -4
View File
@@ -963,11 +963,8 @@ static void G_ResetPlayerDeviceRumble(INT32 playernum)
void G_ResetAllDeviceRumbles(void)
{
int i;
int devices;
devices = I_NumJoys();
for (i = 0; i < devices; i++)
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
{
I_GamepadRumble(i, 0, 0, 0);
}
+2
View File
@@ -1494,6 +1494,7 @@ void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength,
(void)duration;
#else
SDL_GameController *controller = JoyInfo[playernum].dev;
if (controller == NULL)
{
return;
@@ -1512,6 +1513,7 @@ void I_SetGamepadIndicatorColor(INT32 playernum, UINT8 red, UINT8 green, UINT8 b
(void)blue;
#else
SDL_GameController *controller = JoyInfo[playernum].dev;
if (controller == NULL)
{
return;