Avotd crash due to bad array indexing.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 23 Apr 2019 21:59:31 +0000 (17:59 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 23 Apr 2019 21:59:31 +0000 (17:59 -0400)
sst.py

diff --git a/sst.py b/sst.py
index a2cedc575a37e2a08472aec68a0cb3483a6b6383..a9900528bda3b4edf03feb28b2a3decdaa8ce7ff 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -2775,7 +2775,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