Skip to content

Commit

Permalink
Handle no actions correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwatsonforster committed Sep 24, 2023
1 parent 59ed29c commit 5e51e21
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions airpower/aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5e51e21

Please sign in to comment.