Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a non-xinput device joymapping cause game crash #91257

Open
yikescloud opened this issue Apr 27, 2024 · 3 comments · May be fixed by #98792
Open

Remove a non-xinput device joymapping cause game crash #91257

yikescloud opened this issue Apr 27, 2024 · 3 comments · May be fixed by #98792

Comments

@yikescloud
Copy link

yikescloud commented Apr 27, 2024

Tested versions

godot 4.2
godot 3.6

System information

windows 10

Issue description

When multi joypad connect and has a xinput joypad and a non-xinput joypad, remove the non-xinput joypad mapping then press any button on xinput-joypad cause game crash, pop a ERROR: FATAL: Index p_index = 754 is out of bounds (size() = 754). <-- the line in gamecontrollerdb and this line has the xinput mapping
looks like it remove xinput and cannot find it.

Steps to reproduce

You should at least has 2 joypad to reproduce this.
Use Input.remove_joy_mapping remove a non-xinput joypad mapping. then press any button/axis on xinput joypad, game should crash immediate

Minimal reproduction project (MRP)

xinput_crash.zip

@dannygaray60
Copy link

I've encountered the same problem with Godot 3.6beta5. I have two gamepads connected (an Xbox Series one and a generic PS3 one). When using Input.remove_joy_mapping(gamepad_guid), the game crashes and closes without giving any error message.

Deleting the mapping of the XInput controller causes it to close immediately, while deleting the mapping of the PS3 controller only causes it to close when receiving any input from the Xbox controller.

@MJacred MJacred linked a pull request Nov 3, 2024 that will close this issue
@MJacred
Copy link
Contributor

MJacred commented Nov 3, 2024

@yikescloud and @dannygaray60: I think I have a fix for this, could you test my PR #98792 (once the pipeline succeeds). See github artifacts for download: https://github.com/godotengine/godot/actions/runs/11652554953

@MJacred
Copy link
Contributor

MJacred commented Nov 6, 2024

So, I tested the Windows build, but it seems I only have XInput devices. And they don't crash. Neither in 4.2.2, 4.3, nor my PR.

A test from at least one you (or anyone with a DirectInput device) is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants