Fixed a bug in critical-hit processing.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 22 Feb 2012 00:33:54 +0000 (19:33 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 22 Feb 2012 00:33:54 +0000 (19:33 -0500)
sst.py

diff --git a/sst.py b/sst.py
index 22a02919b78fe66be09d52e508f2cc9e0c1ead37..9fb3da9c4eda16b8f6eb64478c9321b5ccc0bcfc 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -1287,7 +1287,6 @@ def fry(hit):
     # Select devices and cause damage
     cdam = []
     while ncrit > 0:
-        ncrit -= 1
         while True:
            j = randdevice()
            # Cheat to prevent shuttle damage unless on ship 
@@ -1296,6 +1295,7 @@ def fry(hit):
        cdam.append(j)
        extradm = (hit*game.damfac)/(ncrit*randreal(75, 100))
        game.damage[j] += extradm
+        ncrit -= 1
     skipcount = 0
     for (i, j) in enumerate(cdam):
        proutn(device[j])