From 75c3096b31c05387b371a47ef366d05d76b01677 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 29 Apr 2024 01:42:00 +0200 Subject: [PATCH] Make `_on_sacrifice_changed` more efficient --- behaviours/summoning_circle.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/behaviours/summoning_circle.gd b/behaviours/summoning_circle.gd index 2723260..0b23c3f 100644 --- a/behaviours/summoning_circle.gd +++ b/behaviours/summoning_circle.gd @@ -58,11 +58,11 @@ func _ready() -> void: refresh_recipes() func _on_sacrifice_changed(_entity: Node2D) -> void: + var entities: Array[Node2D] = [] + entities.assign( + stones.map(func(stone): return stone.entity) + ) for recipe in recipes: - var entities: Array[Node2D] = [] - entities.assign( - stones.map(func(stone): return stone.entity) - ) if recipe.do_match(entities): break