dawidkomorowski / geisha

Game Engine written in C#.
https://dawidkomorowski.github.io/geisha/
MIT License
8 stars 1 forks source link

Exception is thrown when input component is created in action binding #444

Open dawidkomorowski opened 1 year ago

dawidkomorowski commented 1 year ago

Steps to reproduce:

  1. Have InputComponent with action mapping.
  2. Bind action that creates new entity with new InputComponent.
  3. Trigger action binding.

    Expected result:

    • New entity with InputComponent is created.

      Actual Result:

    • Exception is thrown:
      System.InvalidOperationException
      HResult=0x80131509
      Message=Collection was modified; enumeration operation may not execute.
      Source=System.Private.CoreLib
      StackTrace:
      at System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion()
      at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
      at Geisha.Engine.Input.Systems.InputSystem.ProcessInput() in C:\GitRepos\geisha\src\Geisha.Engine\Input\Systems\InputSystem.cs:line 29
      at Geisha.Engine.Core.GameLoop.GameLoop.Update() in C:\GitRepos\geisha\src\Geisha.Engine\Core\GameLoop\GameLoop.cs:line 54
      at Geisha.Engine.Engine.Update() in C:\GitRepos\geisha\src\Geisha.Engine\Engine.cs:line 94
      at Geisha.Engine.Windows.WindowsApplication.<>c__DisplayClass6_1.<Run>b__0() in C:\GitRepos\geisha\src\Geisha.Engine.Windows\WindowsApplication.cs:line 82
      at SharpDX.Windows.RenderLoop.Run(Control form, RenderCallback renderCallback, Boolean useApplicationDoEvents)
      at Geisha.Engine.Windows.WindowsApplication.Run(Game game) in C:\GitRepos\geisha\src\Geisha.Engine.Windows\WindowsApplication.cs:line 79
      at Sandbox.Program.Main() in C:\GitRepos\geisha\sandbox\Sandbox\Program.cs:line 14

Acceptance Criteria

Definition of Done

dawidkomorowski commented 1 year ago

The same scenario should be verified for removal of IncputComponent in action binding.