I've been struggling for some time to correctly implement double and triple spawn prevention via triggers.
I'm working a basic turret defense map, and the last two units in any given wave are occasionally killed at the same time. I have a trigger set up to count the number of units remaining whenever a unit dies, and if there are none left to spawn the next wave. When the last two or three units die at the same time, the next two or three waves spawn all at once.
In an attempt to resolve this issue I created a Double Spawn Prevention variable and set it to 0 after spawning a wave. When the final unit in a wave dies, an If / Then/ Else action checks for Double Spawn Prevention == 0, then sets the Double Spawn Prevention variable to 1 and call the Spawn Waves trigger.
My hope was that this would confine the Spawn Waves trigger to one run per cycle, since the If / Then / Else action would check the Double Spawn Prevention variable and thereby block another spawn until the end of the round. Unfortunately, no such luck.
Any advice on what else I could try? I've copied some of the relevant triggers below, for reference.