From ff3c0d97d3b7d49ed514b09eedde81244a88bd29 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 14 Apr 2024 05:01:27 +0200 Subject: [PATCH] `SkitterFromMouse`: it turns out `randi_range` is inclusive --- behaviours/skitter_from_mouse.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/behaviours/skitter_from_mouse.gd b/behaviours/skitter_from_mouse.gd index 5e85cbe..9ea14da 100644 --- a/behaviours/skitter_from_mouse.gd +++ b/behaviours/skitter_from_mouse.gd @@ -38,7 +38,7 @@ func _physics_process(delta: float) -> void: match state: State.SCARED: if len(directions) > 0: - var idx := Random.rng.randi_range(0, len(directions)) + var idx := Random.rng.randi_range(0, len(directions) - 1) var direction: Vector2 = directions[idx] var movement: Vector2 = direction * delta * speed move.emit(movement)