NoelFB/Celeste

PlayerIndex incorrect

NoelFB opened this issue · 2 comments

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()```

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?

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.