fixed a weird bug, to do with minus world

This commit is contained in:
JHDev2006
2025-10-08 15:35:44 +01:00
parent 5cc8718941
commit 7edfccbd76
8 changed files with 252 additions and 1167 deletions

View File

@@ -81,8 +81,6 @@ func write_save(campaign: String = Global.current_campaign, force := false) -> v
save_json = SAVE_TEMPLATE.duplicate(true)
match Global.current_game_mode:
Global.GameMode.CAMPAIGN:
if Global.world_num < 0:
Global.world_num = 1
if Global.high_score < Global.score:
Global.high_score = Global.score
save_json["World"] = Global.world_num
@@ -117,7 +115,10 @@ func write_save_to_file(json := {}, path := "") -> void:
file.close()
func apply_save(json := {}) -> void:
Global.world_num = json.get_or_add("World", 1)
if Global.world_num < 1:
Global.world_num = 1
Global.level_num = json.get_or_add("Level", 1)
Global.lives = json["Lives"]
Global.coins = json["Coins"]