Merge pull request #11940 from t895/controller-null-check

android: Default to player number 0 if we get an input from an unreco…
master
liamwhite 2023-11-01 13:50:50 +07:00 committed by GitHub
commit 7b10ceda02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -68,7 +68,7 @@ object InputHandler {
private fun getPlayerNumber(index: Int, deviceId: Int = -1): Int { private fun getPlayerNumber(index: Int, deviceId: Int = -1): Int {
var deviceIndex = index var deviceIndex = index
if (deviceId != -1) { if (deviceId != -1) {
deviceIndex = controllerIds[deviceId]!! deviceIndex = controllerIds[deviceId] ?: 0
} }
// TODO: Joycons are handled as different controllers. Find a way to merge them. // TODO: Joycons are handled as different controllers. Find a way to merge them.