From 24aa4aea4bb9d3fa36f7fc2a49eab6b9beb6f5be Mon Sep 17 00:00:00 2001 From: Ategon Date: Sun, 15 Sep 2024 05:40:28 -0400 Subject: [PATCH] Fix win screen bug --- BuildingLevel.gd | 2 +- parts/globals.txt | 1 + storm/storm_manager.gd | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BuildingLevel.gd b/BuildingLevel.gd index f7a10d4..e38c421 100644 --- a/BuildingLevel.gd +++ b/BuildingLevel.gd @@ -78,7 +78,7 @@ func _process(delta: float) -> void: rand = randi_range(0, 1) - if not Persister.get_value("building_mode"): + if not Persister.get_value("building_mode") and Persister.get_value("flood_level", PersisterEnums.Scope.UNKNOWN, 0) < level: if rock_spots.has(tile): last_text = NAME_ICON.instantiate() last_text.text = "[center]Rock" diff --git a/parts/globals.txt b/parts/globals.txt index 13f8a63..3add872 100644 --- a/parts/globals.txt +++ b/parts/globals.txt @@ -17,3 +17,4 @@ flood_levels[] 1 0 5 + 0 diff --git a/storm/storm_manager.gd b/storm/storm_manager.gd index f888fbb..1d0292b 100644 --- a/storm/storm_manager.gd +++ b/storm/storm_manager.gd @@ -21,7 +21,7 @@ func _process(delta: float) -> void: Persister.change_value("days", 1) - if current_flood_state > globals.flood_levels.size(): + if current_flood_state >= globals.flood_levels.size() + 1: Persister.persist_data("win", true) return