From 7cd0c2ced246a7975bcfad9d0be49b655541c6dd Mon Sep 17 00:00:00 2001 From: Moe Poi ~ Date: Sat, 21 Oct 2023 23:42:53 +0700 Subject: [PATCH] Fix bug on unlock next stage --- scripts/ui/victory.gd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ui/victory.gd b/scripts/ui/victory.gd index 95ed736..f555606 100644 --- a/scripts/ui/victory.gd +++ b/scripts/ui/victory.gd @@ -14,8 +14,9 @@ func set_next_stage(value: int): func unlock_next_stage(): if next_stage != 0: - data['unlocked_stage'] = next_stage - game_data.save_data(data) + if data['unlocked_stage'] < next_stage: + data['unlocked_stage'] = next_stage + game_data.save_data(data) func _on_next_stage_pressed(): get_tree().paused = false