mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
fixed a weird bug, to do with minus world
This commit is contained in:
@@ -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"]
|
||||
|
Reference in New Issue
Block a user