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:
1 parent
8b5fd5f646
commit
121540f428
2 files changed
+3
-4
No files matched your search
+1
-4
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1485,6 +1485,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;
|
||||
@@ -1503,6 +1504,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;
|
||||
|
||||
Reference in new issue
Block a user