belovachap / SubBoomUnity

1 stars 1 forks source link

Correct Random.Range for explosion noises, modify explosion list outs… #24

Closed belovachap closed 3 months ago

belovachap commented 3 months ago

…ide of initial foreach loop.

The Random.Range(0,6) would occasionally return the number 5 which is one too many for the array of explosion sound effects which would lead to the Index Out Of Bounds error seen in #22 and the "zombie explosions" that wouldn't clear.

I also updated the explosion foreach loop to remove dead explosions in a second pass to avoid errors about modifying the list during its enumeration.