Subterfuge-Revived / Remake-Core

Core repository that holds all game logic for both front end rendering and back end validation.
Creative Commons Zero v1.0 Universal
39 stars 24 forks source link

Event queueing system infinite loop with multiple launch events #33

Closed pisanovo closed 3 years ago

pisanovo commented 4 years ago

The event queueing system falls into an infinite loop if a Goto(GameTick) action is performed with two or more LaunchEvents scheduled in the futureEventQueue at the same tick. The scheduler takes the first LaunchEvent, puts it into the pastEventQueue and generates the associated CombatEvents. It does the same for the second LaunchEvent but then removes the first one and it's CombatEvents after which it is placed in the futureEventQueue. This should not happen.

Expected Behavior

It should be possible to launch more than one sub at the same tick.

Current Behavior

Launching more than one sub at the same tick crashes the game.

Possible Solution

Steps to Reproduce

  1. Try to launch two or more subs at the same tick (outpost start and destination do not matter)
QuinnBast commented 3 years ago

I've confirmed that this is indeed a problem.