Fix bug in hittem().
[super-star-trek.git] / sst.py
diff --git a/sst.py b/sst.py
index e79dd5b58d4d8ec3daa65b6eba15f84e808bfe75..f34358a846b66835958d1ff4bdcb587d3ff59b1f 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -1801,6 +1801,9 @@ def hittem(hits):
     skip(1)
     kk = 0
     for wham in 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)
         if wham == 0:
             continue
         dustfac = randreal(0.9, 1.0)
@@ -1832,7 +1835,6 @@ def hittem(hits):
                 finish(FWON)
             if game.alldone:
                 return
                 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:
             continue
         else: # decide whether or not to emasculate klingon
             if kpow > 0 and withprob(0.9) and kpow <= randreal(0.4, 0.8)*kpini: