]> git.pond.sub.org Git - empserver/commitdiff
(shp_missile_defense): Move big assignment out of if condition for
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 Mar 2004 14:21:11 +0000 (14:21 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 Mar 2004 14:21:11 +0000 (14:21 +0000)
clarity.

src/lib/subs/shpsub.c

index a0a47059f38f56ce11360bb1f984b1c5ee51a960..6a8e10f258c24863433be1efc8cdd9209c3d144b 100644 (file)
@@ -956,9 +956,10 @@ shp_missile_defense(coord dx, coord dy, natid bombown, int hardtarget)
        if (vec[I_MILIT] < 1)   /* do we have mil? */
            continue;
        if (vec[I_SHELL] < 2) { /* do we need shells */
-           if (vec[I_SHELL] += supply_commod(ship.shp_own,
-                                             ship.shp_x,
-                                             ship.shp_y, I_SHELL, 2) < 2)
+           vec[I_SHELL] += supply_commod(ship.shp_own,
+                                         ship.shp_x, ship.shp_y,
+                                         I_SHELL, 2);
+           if (vec[I_SHELL] < 2)
                continue;
        }
        if (vec[I_GUN] < 1)     /* we need at least 1 gun */