Jelajahi Sumber

android: Default to player number 0 if we get an input from an unrecognized controller

Charles Lombardo 2 tahun lalu
induk
melakukan
344162db75

+ 1 - 1
src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt

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