Fix event command "Return to Title Screen" (#124)

Fix loading a game after event command "Return to Title Screen" starting a loop.
This commit is contained in:
FL
2021-08-12 16:23:27 -03:00
committed by infinitefusion
parent 7d425b0e05
commit 9ce8b92fbd
2 changed files with 14 additions and 0 deletions

View File

@@ -75,6 +75,11 @@ module SaveData
return @loaded
end
# Marks value as unloaded.
def mark_as_unloaded
@loaded = false
end
# Uses the {#from_old_format} proc to select the correct data from
# +old_format+ and return it.
# Returns nil if the proc is undefined.
@@ -221,6 +226,13 @@ module SaveData
load_values(save_data) { |value| !value.loaded? }
end
# Marks all values that aren't loaded on bootup as unloaded.
def self.mark_values_as_unloaded
@values.each do |value|
value.mark_as_unloaded unless value.load_in_bootup?
end
end
# Loads each value from the given save data that has
# been set to be loaded during bootup. Done when a save file exists.
# @param save_data [Hash] save data to load

View File

@@ -187,6 +187,8 @@ class Scene_Map
end
updateSpritesets
if $game_temp.to_title
$game_temp.to_title = false
SaveData.mark_values_as_unloaded
$scene = pbCallTitle
return
end