Rumble request panics if gamepad not found
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
The `handle_rumble_request` does a `.unwrap()` if it can't find a gamepad entity matching the request:
https://github.com/bevyengine/bevy/blob/main/crates/bevy_gilrs/src/rumble.rs#L92
Here's why I think we should change this: I'm envisioning a world in which steaminput game controllers also have entities, and it would be nice to be able to re-use the rumble request request for those as well. Technically, there is no barrier in the steam API that would prevent this.
Normally when running under Steam, the gilrs plugin would be disabled; but if for some reason it isn't, asking a steam controller to rumble would cause a panic.
See also #25757
@alice-i-cecile
Contributor guide
Research direction
Start at crates/bevy_gilrs/src/rumble.rs:92 and inspect handle_rumble_request, then trace how requests for unmatched gamepad entities are handled. Verify the missing-gamepad and Steam-controller scenarios described here; done means the request no longer panics while existing rumble behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100