From 42fe10c4211be90df7ad867ce88255693a3f4b63 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 25 Feb 2017 09:02:11 -0500 Subject: [PATCH] Fix bug in hittem(). --- sst.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- 2.31.1