This is my code:
OnBegin<override>()<suspends>:void= PrintBarrierLength() RemoveNextBarrier(AreaID : int) : void = Print("Barrier removal starting. Stage: {AreaID} Barriers Length: {Barriers.Length}") if (var CurrentBarrier : barrier_device = Barriers[AreaID]): Print("Barrier found, removing.") CurrentBarrier.Disable() PrintBarrierLength() : void = Print("Barriers Length: {Barriers.Length}")
I’m setting it up with a single barrier device in the array. My first print shows the Barriers.Length as 0. What am I doing wrong?
Note: I have added quite a bit of logging in to attempt debugging this. It looks like the length of the array changes as I enter the RemoveNextBarrier function; I am tracking this through prints, and I’m pretty sure something in here is a bug. Is it possible that disabling the barrier is predicted and happens before I actually do it? The barrier stays in place, but the array is showing as empty and nothing actually happens.
LogVerse: : Dodging with prop 5
LogVerse: : Barriers Length: 1
LogVerse: : All Targets Destroyed
LogVerse: : Moving to next stage. Current stage : 0
LogVerse: : Barrier removal starting. Stage: 0 Barriers Length: 0