Explanatory comment.
[super-star-trek.git] / sst.py
diff --git a/sst.py b/sst.py
index a2cedc575a37e2a08472aec68a0cb3483a6b6383..8e14eb282e34bcfd39a004e24d9b188e15902c6b 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -38,7 +38,8 @@ def _(st):
 
 # This is all encapsulated not just for logging but because someday
 # we'll probably want to replace it with something like an LCG that
-# can be forward-ported off Python.
+# can be forward-ported off Python.  Thee only function we need is one to
+# return a variate uniformly-distributed over [0, 1).
 
 import random
 
@@ -2775,7 +2776,8 @@ def nova(nov):
                         finish(FNOVA)
                         return
                     # add in course nova contributes to kicking starship
-                    bump += (game.sector-hits[-1]).sgn()
+                    if hits:
+                        bump += (game.sector-hits[-1]).sgn()
                 elif iquad == 'K': # kill klingon
                     deadkl(neighbor, iquad, neighbor)
                 elif iquad in ('C','S','R'): # Damage/destroy big enemies