X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.py;h=8e14eb282e34bcfd39a004e24d9b188e15902c6b;hp=a2cedc575a37e2a08472aec68a0cb3483a6b6383;hb=51385f97081d4ca782e7b5c5945024bc5350d83a;hpb=bb6c8c6171a2ffb2350e18240799d3582fdc6d27 diff --git a/sst.py b/sst.py index a2cedc5..8e14eb2 100755 --- 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