From 45f450fca5c7fabbb30e0d193d1f4a1be6bd287b Mon Sep 17 00:00:00 2001 From: t895 Date: Wed, 21 Feb 2024 08:17:30 -0500 Subject: android: Add additional check for hasMapping Controls can have no mapping if they are either "[empty]" or and empty string. This was causing an issue if you reset mapping on all controllers and then tried to play a game. The check to determine whether auto mapping was required would fail and leave you will no mapped controllers. This feels a bit like user error but it smooths things out if you forget so I see it as necessary. --- .../main/java/org/yuzu/yuzu_emu/features/input/model/PlayerInput.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/android/app') diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/PlayerInput.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/PlayerInput.kt index d35de80c4..a84ac77a2 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/PlayerInput.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/PlayerInput.kt @@ -64,17 +64,17 @@ data class PlayerInput( fun hasMapping(): Boolean { var hasMapping = false buttons.forEach { - if (it != "[empty]") { + if (it != "[empty]" && it.isNotEmpty()) { hasMapping = true } } analogs.forEach { - if (it != "[empty]") { + if (it != "[empty]" && it.isNotEmpty()) { hasMapping = true } } motions.forEach { - if (it != "[empty]") { + if (it != "[empty]" && it.isNotEmpty()) { hasMapping = true } } -- cgit v1.2.3