Save/Load fix

Updated default save and load file functions to save and load the extra
data that oneshot saves (followers and fast travel).  Also updated the
default save/load and the new save/load to save the footstep_sfx array,
since otherwise maps have no footstep sfx after loading a save until you
change map.
This commit is contained in:
Michael Shirt 2016-09-20 13:11:10 -06:00
parent 8a99e0716f
commit 2ade85c03a
3 changed files with 9 additions and 0 deletions

View file

@ -22,6 +22,7 @@ def save
Marshal.dump($game_followers, file)
Marshal.dump($game_oneshot, file)
Marshal.dump($game_fasttravel, file)
Marshal.dump($game_temp.footstep_sfx , file)
end
end
@ -43,6 +44,7 @@ def load
$game_followers = Marshal.load(file)
$game_oneshot = Marshal.load(file)
$game_fasttravel = Marshal.load(file)
$game_temp.footstep_sfx = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number

View file

@ -80,7 +80,11 @@ class Scene_Load < Scene_File
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
$game_followers = Marshal.load(file)
$game_oneshot = Marshal.load(file)
$game_fasttravel = Marshal.load(file)
$game_temp.footstep_sfx = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number

View file

@ -80,6 +80,9 @@ class Scene_Save < Scene_File
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
Marshal.dump($game_followers, file)
Marshal.dump($game_oneshot, file)
Marshal.dump($game_fasttravel, file)
Marshal.dump($game_temp.footstep_sfx , file)
end
end