fix sequences not being able to jump indexes during setup

This commit is contained in:
betalars 2025-06-03 23:10:46 +02:00
parent 40ae307c66
commit 8b35e09f42
1 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,9 @@ func _ready() -> void:
sequence_actors.append([null, null])
func sign_up_for_sequence(callable: Callable, sequence_id: id, index: int):
# if this assertion fails, two objects tried to sign up for the same sequence or an empty slot has been missing.
if sequence_actors[sequence_id].size() <= index:
sequence_actors[sequence_id].resize(index+1)
# if this assertion fails, two objects tried to sign up for the same sequence.
assert(sequence_actors[sequence_id][index] == null)
sequence_actors[sequence_id][index] = callable