Skip to content

Commit

Permalink
fix(nurturing): error when race turns incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Aug 23, 2021
1 parent 7be9798 commit b913793
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions auto_derby/jobs/nurturing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding=UTF-8 -*-
# pyright: strict
from __future__ import annotations
from auto_derby.scenes.single_mode.race_menu import RaceMenuScene
from auto_derby.scenes.single_mode.race_menu import RaceMenuScene, RaceTurnsIncorrect

import logging
import time
Expand Down Expand Up @@ -43,7 +43,10 @@ def _handle_turn(ctx: Context):
LOGGER.info("context: %s", ctx)
for c, s in command_with_scores:
LOGGER.info("score:\t%2.2f:\t%s", s, c.name())
command_with_scores[0][0].execute(ctx)
try:
command_with_scores[0][0].execute(ctx)
except RaceTurnsIncorrect:
_handle_turn(ctx)


def nurturing():
Expand Down

0 comments on commit b913793

Please sign in to comment.