Browse Source

SDL_SendJoystickVirtualSensorDataInner(): Fix max_sensor_events increment

(cherry picked from commit d9c20cfd0a2320348bc62caea64204e5e8859a08)
Petar Popovic 1 month ago
parent
commit
b5bc6d2cc4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/joystick/virtual/SDL_virtualjoystick.c

+ 1 - 1
src/joystick/virtual/SDL_virtualjoystick.c

@@ -471,7 +471,7 @@ bool SDL_SendJoystickVirtualSensorDataInner(SDL_Joystick *joystick, SDL_SensorTy
             return false;
             return false;
         }
         }
         hwdata->sensor_events = sensor_events;
         hwdata->sensor_events = sensor_events;
-        hwdata->max_sensor_events = hwdata->max_sensor_events;
+        hwdata->max_sensor_events = new_max_sensor_events;
     }
     }
 
 
     VirtualSensorEvent *event = &hwdata->sensor_events[hwdata->num_sensor_events++];
     VirtualSensorEvent *event = &hwdata->sensor_events[hwdata->num_sensor_events++];