1
0
Fork 0

fix finish bug

This commit is contained in:
Lili (Tlapka) 2021-03-31 18:23:05 +02:00
parent 792b8905c2
commit 1702bdc73b
1 changed files with 7 additions and 2 deletions

View File

@ -322,6 +322,11 @@ def game_loop():
except NoLevelFoundError as err: except NoLevelFoundError as err:
print("Error encountered: {}".format(err)) print("Error encountered: {}".format(err))
elif command in ("f", "finish", "(f)inish"): elif command in ("f", "finish", "(f)inish"):
if (not game.game_in_progress and not game.game_finished):
print("Can't finish game, game was not started yet.")
elif (not game.game_in_progress and game.game_finished):
print("Can't finish game, game was already finished earlier.")
else:
if check_flag(game.level, flag_checker): if check_flag(game.level, flag_checker):
finish_game(game) finish_game(game)
elif command in ("i", "info", "information", "(i)nfo", "(i)nformation"): elif command in ("i", "info", "information", "(i)nfo", "(i)nformation"):