From 5e51e21ce13815ad0c3e1475ef12f4cd4abc324d Mon Sep 17 00:00:00 2001 From: alanwatsonforster <68709385+alanwatsonforster@users.noreply.github.com> Date: Sat, 23 Sep 2023 22:52:48 -0600 Subject: [PATCH] Handle no actions correctly. --- airpower/aircraft.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/airpower/aircraft.py b/airpower/aircraft.py index 7a7101f5..7a917d0b 100644 --- a/airpower/aircraft.py +++ b/airpower/aircraft.py @@ -378,21 +378,22 @@ def startturn(self, turn, ap, actions): speed = "%.1f" % self._speed self._report("speed is %s and %.1f FPs are available." % (speed, self._nfp)) - if actions != "": - self.continueturn(actions) + self.continueturn(actions) def continueturn(self, actions): if self._destroyed or self._leftmap: return - if self._hfp + self._vfp + self._sfp == 0: - self._report("---") - self._reportactionsandposition("") + if actions != "": + + if self._hfp + self._vfp + self._sfp == 0: + self._report("---") + self._reportactionsandposition("") - for action in actions.split(","): - if not self._destroyed and not self._leftmap: - self._doaction(action) + for action in actions.split(","): + if not self._destroyed and not self._leftmap: + self._doaction(action) assert self._hfp + self._vfp + self._sfp <= self._nfp