Restore kill crediting. Required two rebuilds of regression-test loads.
[super-star-trek.git] / sst.py
diff --git a/sst.py b/sst.py
index 3c94f8f842f701f59fa579387319195b98b1edc8..db33c54e20577b40474f92ac7474d1c4c6782073 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -274,8 +274,8 @@ def communicating():
     return not damaged(DRADIO) or game.condition=="docked"
 
 # Define future events
-FSPY        = 0        # Spy event happens always (no future[] entry)
-                # can cause SC to tractor beam Enterprise
+FSPY    = 0        # Spy event happens always (no future[] entry)
+                   # can cause SC to tractor beam Enterprise
 FSNOVA  = 1        # Supernova
 FTBEAM  = 2        # Commander tractor beams Enterprise
 FSNAP   = 3        # Snapshot for time warp
@@ -1801,9 +1801,6 @@ 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)
@@ -3889,7 +3886,7 @@ def dock(verbose):
         prout(_("%d captured Klingons transferred to base") % (game.brigcapacity-game.brigfree))
         game.kcaptured += game.brigcapacity-game.brigfree
         game.brigfree = game.brigcapacity
-    if not damaged(DRADIO) and \
+    if communicating() and \
         ((is_scheduled(FCDBAS) or game.isatb == 1) and not game.iseenit):
         # get attack report from base
         prout(_("Lt. Uhura- \"Captain, an important message from the starbase:\""))
@@ -4016,16 +4013,15 @@ def getcourse(isprobe):
             iprompt = True
             key = scanner.nexttok()
         itemp = "verbose"
-        if key == "IHREAL":
-            delta.j = scanner.real
-        else:
+        if key != "IHREAL":
             huh()
             raise TrekError
+        delta.j = scanner.real
         key = scanner.nexttok()
-        if key == "IHREAL":
-            delta.i = scanner.real
-        else:
-            delta.i = 0
+        if key != "IHREAL":
+            huh()
+            raise TrekError
+        delta.i = scanner.real
     # Check for zero movement
     if delta.i == 0 and delta.j == 0:
         scanner.chew()
@@ -5256,7 +5252,7 @@ def chart():
     scanner.chew()
     if (game.options & OPTION_AUTOSCAN):
         lrscan(silent=True)
-    if not damaged(DRADIO):
+    if communicating():
         rechart()
     if game.lastchart < game.state.date and game.condition == "docked":
         prout(_("Spock-  \"I revised the Star Chart from the starbase's records.\""))
@@ -5392,7 +5388,7 @@ def srscan():
             prout(_("  [Using Base's sensors]"))
     else:
         prout(_("     Short-range scan"))
-    if goodScan and not damaged(DRADIO):
+    if goodScan and communicating():
         game.state.chart[game.quadrant.i][game.quadrant.j].klingons = game.state.galaxy[game.quadrant.i][game.quadrant.j].klingons
         game.state.chart[game.quadrant.i][game.quadrant.j].starbase = game.state.galaxy[game.quadrant.i][game.quadrant.j].starbase
         game.state.chart[game.quadrant.i][game.quadrant.j].stars = game.state.galaxy[game.quadrant.i][game.quadrant.j].stars
@@ -6286,7 +6282,8 @@ def makemoves():
                 huh()
             else:
                 break
-        prout("COMMAND> %s" % cmd)
+        if game.options & OPTION_CURSES:
+            prout("COMMAND> %s" % cmd)
         if cmd == "SRSCAN":                # srscan
             srscan()
         elif cmd == "STATUS":                # status