]> git.pond.sub.org Git - empserver/commitdiff
subs: Drop contains_engineer(), lnd_find_capable() can do
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 29 Dec 2014 19:13:21 +0000 (20:13 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:13:15 +0000 (16:13 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/lndsub.c

index 94a1e41a44a4cb8327465087c16fab25d9344c3e..5d34e7e287cc6e7a51796ec780fa4237d73519c7 100644 (file)
@@ -675,22 +675,6 @@ lnd_sweep(struct emp_qelem *land_list, int explicit, int takemob,
     return stopping;
 }
 
-static int
-contains_engineer(struct emp_qelem *list)
-{
-    struct emp_qelem *qp;
-    struct emp_qelem *next;
-    struct ulist *llp;
-
-    for (qp = list->q_back; qp != list; qp = next) {
-       next = qp->q_back;
-       llp = (struct ulist *)qp;
-       if (lchr[llp->unit.land.lnd_type].l_flags & L_ENGINEER)
-           return 1;
-    }
-    return 0;
-}
-
 static int
 lnd_check_one_mines(struct ulist *llp, int with_eng)
 {
@@ -719,7 +703,7 @@ lnd_check_mines(struct emp_qelem *land_list)
     struct emp_qelem *next;
     struct ulist *llp;
     int stopping = 0;
-    int with_eng = contains_engineer(land_list);
+    int with_eng = !!lnd_find_capable(land_list, L_ENGINEER);
 
     for (qp = land_list->q_back; qp != land_list; qp = next) {
        next = qp->q_back;