mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Handles exception when failing to create savefil backups
This commit is contained in:
@@ -810,6 +810,7 @@ module Game
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.backup_savefile(save_path, slot)
|
def self.backup_savefile(save_path, slot)
|
||||||
|
begin
|
||||||
backup_dir = File.join(File.dirname(save_path), "backups")
|
backup_dir = File.join(File.dirname(save_path), "backups")
|
||||||
Dir.mkdir(backup_dir) if !Dir.exist?(backup_dir)
|
Dir.mkdir(backup_dir) if !Dir.exist?(backup_dir)
|
||||||
|
|
||||||
@@ -838,6 +839,10 @@ module Game
|
|||||||
excess_backups.each { |old_backup| File.delete(old_backup) }
|
excess_backups.each { |old_backup| File.delete(old_backup) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue => e
|
||||||
|
echoln ("There was an error while creating a backup savefile.")
|
||||||
|
echoln("Error: #{e.message}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Saves the game. Returns whether the operation was successful.
|
# Saves the game. Returns whether the operation was successful.
|
||||||
|
|||||||
Reference in New Issue
Block a user