From 4c031db83da6e9419aebf0ab45966304267ca042 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 8 Jan 2023 00:12:24 +0100 Subject: [PATCH] Bail on `plant()` and `complete()` if already in that state --- island/CropTile.gd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/island/CropTile.gd b/island/CropTile.gd index 6a2fd93..b63138d 100644 --- a/island/CropTile.gd +++ b/island/CropTile.gd @@ -10,13 +10,15 @@ signal on_complete() func plant(): - growth_timer.start() - emit_signal("on_planted") + if growth_timer.is_stopped(): + growth_timer.start() + emit_signal("on_planted") func complete(): - growth_timer.stop() - emit_signal("on_complete") + if not growth_timer.is_stopped(): + growth_timer.stop() + emit_signal("on_complete") func _process(_delta):