summaryrefslogtreecommitdiffstats
path: root/src/core/re3.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-12 17:50:26 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-12 19:10:52 +0100
commit0ec16a5b0ecb85808553141c2657c957fc585dc9 (patch)
tree9a43d027d20a5a8529f1c7c2ff67e1d6dc518935 /src/core/re3.cpp
parentFix sha1 on premake linux (diff)
downloadre3-0ec16a5b0ecb85808553141c2657c957fc585dc9.tar
re3-0ec16a5b0ecb85808553141c2657c957fc585dc9.tar.gz
re3-0ec16a5b0ecb85808553141c2657c957fc585dc9.tar.bz2
re3-0ec16a5b0ecb85808553141c2657c957fc585dc9.tar.lz
re3-0ec16a5b0ecb85808553141c2657c957fc585dc9.tar.xz
re3-0ec16a5b0ecb85808553141c2657c957fc585dc9.tar.zst
re3-0ec16a5b0ecb85808553141c2657c957fc585dc9.zip
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r--src/core/re3.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 06789e4a..bd9a46df 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -279,6 +279,14 @@ void LoadINIControllerSettings()
CPad::XInputJoy2 = i;
}
}
+
+ // There is no plug event on XInput, so let's leave XInputJoy1/2 as 0/1 respectively, and hotplug will be possible.
+ if (CPad::XInputJoy1 == -1) {
+ CPad::XInputJoy1 = 0;
+ CPad::XInputJoy2 = 1;
+ } else if (CPad::XInputJoy2 == -1) {
+ CPad::XInputJoy2 = (CPad::XInputJoy1 + 1) % 4;
+ }
}
#else
ReadIniIfExists("Controller", "JoystickName", gSelectedJoystickName, 128);