NoelFB / Celeste

Celeste Bugs & Issue Tracker + some Source Code
MIT License
3.54k stars 419 forks source link

PlayerIndex incorrect #1

Open NoelFB opened 6 years ago

NoelFB commented 6 years ago

Not sure what causes this or how it becomes invalid. Error log:


2/22/2018 12:32:21 PM
System.InvalidOperationException: An invalid operation was performed. Is your PlayerIndex correct?
   at Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex playerIndex, GamePadDeadZone deadZoneMode)
   at Monocle.MInput.GamePadData.Update()
   at Monocle.MInput.Update()
   at Monocle.Engine.Update(GameTime gameTime)
   at Celeste.Celeste.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at Monocle.Engine.RunWithLogging()```
A1rPun commented 6 years ago

The GetState method will throw this error if the gamepad is disconnected. I assume GetState gets called after GamePad.IsConnected is checked in the code. Im not sure how you keep track of playerindexes but if that's implemented well then this bug is a rare occurrence IMO.

Try different controllers maybe to exclude hardware failures?

AgentSmith8 commented 6 years ago

For me calibrating the controller via Steam fixed the problem (Setting > Controller > General Controller Settings). I only had this issue with Celeste, so the controller seemed to be calibrated just fine. This did the trick, though.

Hope this helps others as well.