From d29563ad6d3467aa9e7709f9f3bceeb41a3939a5 Mon Sep 17 00:00:00 2001 From: betalars Date: Tue, 3 Jun 2025 23:10:46 +0200 Subject: [PATCH] fix sequences not being able to jump indexes during setup --- src/singletons/scene_reference.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/singletons/scene_reference.gd b/src/singletons/scene_reference.gd index e56e3694..9bd8ae7a 100644 --- a/src/singletons/scene_reference.gd +++ b/src/singletons/scene_reference.gd @@ -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