Commit 638db72
committed
fix: cap evshim's vjoy count to currently-connected controllers
EVSHIM_MAX_PLAYERS was hardcoded to WinHandler.MAX_PLAYERS (=4), so
evshim always registered four SDL virtual joysticks regardless of how
many physical controllers were actually connected. Games (ToS, etc.)
would see one or more phantom unbound gamepads — they didn't respond
to input because no slot had a controller, and rumble routed at them
went nowhere because getControllerForSlot returned null.
Cap to controllerManager.getDetectedDevices().size() with a floor of 1
so the virtual on-screen gamepad still has a vjoy when no physical
controller is present at launch. Mem files for all four slots are
still pre-created; only the SDL vjoy registration is bounded.1 parent 2f045e3 commit 638db72
1 file changed
Lines changed: 11 additions & 3 deletions
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
| |||
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
226 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
| |||
0 commit comments