From f72281b7739760f71cf20433f1723c8a8e94d7ef Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 1 Mar 2004 14:21:11 +0000 Subject: [PATCH] (shp_missile_defense): Move big assignment out of if condition for clarity. --- src/lib/subs/shpsub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/subs/shpsub.c b/src/lib/subs/shpsub.c index a0a47059..6a8e10f2 100644 --- a/src/lib/subs/shpsub.c +++ b/src/lib/subs/shpsub.c @@ -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 */