]> git.pond.sub.org Git - empserver/commitdiff
(guerrilla): Security units' raid was broken in 4.0.0: the number of
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 26 Apr 2006 16:43:25 +0000 (16:43 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 26 Apr 2006 16:43:25 +0000 (16:43 +0000)
che killed was 100 times too small, thus zero for all practical cases.
4.2.7 attempted to fix it, but left it broken for efficiency < 100.
It also increased deadliness of 100% units by a factor of 2.5.
Restore pre-4.0.0 behavior.

src/lib/update/revolt.c

index 3d19adea68d5a7e90a234b8f0b9e176a6f103e3d..82dc2133390ff843ead76232ca631da5f3af692e 100644 (file)
@@ -184,11 +184,10 @@ guerrilla(struct sctstr *sp)
 
            lcp = &lchr[(int)lp->lnd_type];
            mil += lnd_getmil(lp);
 
            lcp = &lchr[(int)lp->lnd_type];
            mil += lnd_getmil(lp);
-           r = (((float)(lp->lnd_effic / 100) * (float)(lnd_getmil(lp))) /
-                2);
-           if (r < 2)
-               r = 2;
-           che_kill = (roll(r) - 1);
+           r = (lnd_getmil(lp) * lp->lnd_effic) / 500;
+           if (r < 1)
+               r = 1;
+           che_kill = roll(r);
            if (che_kill > che)
                che_kill = che;
            if (che_kill) {
            if (che_kill > che)
                che_kill = che;
            if (che_kill) {