fix a bug if XINPUTGETBATTERYINFORMATION is nullptr

This commit is contained in:
Your Name 2022-08-12 21:05:37 +08:00 committed by Ryan C. Gordon
parent f42291ce68
commit cfbeb438c1

View file

@ -338,7 +338,9 @@ RAWINPUT_UpdateXInput()
xinput_state[user_index].connected = SDL_FALSE;
}
xinput_state[user_index].battery.BatteryType = BATTERY_TYPE_UNKNOWN;
XINPUTGETBATTERYINFORMATION(user_index, BATTERY_DEVTYPE_GAMEPAD, &xinput_state[user_index].battery);
if (XINPUTGETBATTERYINFORMATION) {
XINPUTGETBATTERYINFORMATION(user_index, BATTERY_DEVTYPE_GAMEPAD, &xinput_state[user_index].battery);
}
}
}
}