Skip to content

Commit

Permalink
handle better if character fails to load, init loaded_character in dr…
Browse files Browse the repository at this point in the history
…iver
  • Loading branch information
neph1 committed Aug 9, 2023
1 parent 1e1fea7 commit ec2ff95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tale/driver_if.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def __init__(self, *, screen_delay: int=DEFAULT_SCREEN_DELAY, gui: bool=False, w
self.loaded_character = character_loader.load_from_json(character_to_load)
elif '.png' in character_to_load or '.jpg' in character_to_load:
self.loaded_character = character_loader.load_image(character_to_load)
else:
print("Failed to load character, must be .json, .jpg or .png")
self.loaded_character = None
else:
self.loaded_character = None

def start_main_loop(self):
if self.io_type == "web":
Expand Down

0 comments on commit ec2ff95

Please sign in to comment.