diff --git a/src/levelloader.py b/src/levelloader.py index a49a4d7..a2d95c7 100644 --- a/src/levelloader.py +++ b/src/levelloader.py @@ -225,14 +225,16 @@ def level_prompt(self, scrn: curses.window) -> str: curses.noecho() if raw_choice == QUIT: raise KeyboardInterrupt - else: - try: - choice = int(raw_choice) - if choice in range(1, len(level_names) + 1): - break - except ValueError: - pass - prompt = invalid_input_prompt + + try: + choice = int(raw_choice) + if choice in range(1, len(level_names) + 1): + break + except ValueError: + pass + + prompt = invalid_input_prompt + choice -= 1 chosen_level_name = level_names[choice] return chosen_level_name.rstrip()