cbcerquiaga / YouMeAndTheEndOfTheWorld

A 2 player RPG set in a post-asteroid Earth and created with the Godot engine
MIT License
13 stars 4 forks source link

Music scene gets index out of bounds #216

Open cbcerquiaga opened 5 years ago

cbcerquiaga commented 5 years ago

When both players are playing and collecting lots of notes, there is an indexOutOfBounds error at line 197 in MusicMinigame.

if notes.size() > 0: for i in range (0, notes.size() - 1): var nextNote = notes[i]

I suspect this has to do with how we call notes.remove(i) later on in the function, because the function is still looping through all of the notes and if a note is collected (and removed) before one that spawned before it, then the index of that next note would be out of bounds. Not sure if that's what's happening or not though.