1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 15:44:23 +00:00

Make _on_sacrifice_changed more efficient

This commit is contained in:
Steffo 2024-04-29 01:42:00 +02:00
parent 872ce5673f
commit 75c3096b31
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -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