From: Eric S. Raymond Date: Sat, 25 Feb 2017 14:02:11 +0000 (-0500) Subject: Fix bug in hittem(). X-Git-Tag: 2.2~27 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=42fe10c4211be90df7ad867ce88255693a3f4b63;p=super-star-trek.git Fix bug in hittem(). --- diff --git a/sst.py b/sst.py index e79dd5b..f34358a 100755 --- a/sst.py +++ b/sst.py @@ -1801,6 +1801,9 @@ def hittem(hits): skip(1) kk = 0 for wham in hits: + if not kk < len(game.enemies): + # Should never happen. + break if wham == 0: continue dustfac = randreal(0.9, 1.0) @@ -1832,7 +1835,6 @@ def hittem(hits): finish(FWON) if game.alldone: return - kk -= 1 # don't do the increment continue else: # decide whether or not to emasculate klingon if kpow > 0 and withprob(0.9) and kpow <= randreal(0.4, 0.8)*kpini: