New lnd_mission_interdiction()
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Jan 2010 08:40:01 +0000 (09:40 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Jan 2010 07:37:05 +0000 (08:37 +0100)
Factored out of lnd_interdict().  No functional change.

src/lib/subs/lndsub.c

index e2378271a8408ca96001a70b40fb19bd3568b218..f9add5cc8c4dc828fb30b5d4fe976dd4baac6556 100644 (file)
@@ -805,6 +805,16 @@ lnd_fort_interdiction(struct emp_qelem *list,
 }
 #endif
 
+static int
+lnd_mission_interdiction(struct emp_qelem *list, coord x, coord y,
+                        natid victim)
+{
+    return lnd_damage(list,
+                     unit_interdict(x, y, victim, "land units",
+                                    lnd_easiest_target(list),
+                                    MI_INTERDICT));
+}
+
 int
 lnd_interdict(struct emp_qelem *list, coord newx, coord newy, natid victim)
 {
@@ -816,11 +826,7 @@ lnd_interdict(struct emp_qelem *list, coord newx, coord newy, natid victim)
        stopping |= lnd_fort_interdiction(list, newx, newy, victim);
 #endif
 
-    stopping |=
-       lnd_damage(list,
-                  unit_interdict(newx, newy, victim, "land units",
-                                 lnd_easiest_target(list), MI_INTERDICT));
-
+    stopping |= lnd_mission_interdiction(list, newx, newy, victim);
     stopping |=
        lnd_damage(list,
                   lnd_missile_interdiction(list, newx, newy, victim));