Test loading wrong saves
This commit is contained in:
@ -139,7 +139,15 @@ class Game:
|
||||
"""
|
||||
Loads the game from a dictionary
|
||||
"""
|
||||
self.map.load_state(d)
|
||||
try:
|
||||
self.map.load_state(d)
|
||||
except KeyError:
|
||||
self.message = "Some keys are missing in your save file.\n" \
|
||||
"Your save seems to be corrupt. It got deleted."
|
||||
os.unlink(ResourceManager.get_config_path("save.json"))
|
||||
self.display_actions(DisplayActions.UPDATE)
|
||||
return
|
||||
|
||||
players = self.map.find_entities(Player)
|
||||
if not players:
|
||||
self.message = "No player was found on this map!\n" \
|
||||
|
Reference in New Issue
Block a user