]> git.pond.sub.org Git - empserver/commitdiff
Fix ground combat to report defending land units
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 31 May 2008 08:35:47 +0000 (10:35 +0200)
committerMarkus Armbruster <armbru@pike.pond.sub.org>
Tue, 10 Jun 2008 08:25:05 +0000 (10:25 +0200)
Commit 092a52f2 (v4.3.4) removed the code to estimate defense, because
the use of the estimate had been disabled since v4.0.0.  This
accidentally removed the reporting of defending units, because
get_dlist() reported them when called for an estimate, and not when
called for real.

Fix by removing the unused estimate capability from get_dlist().  It
now reports defending units always.
(cherry picked from commit 64f44e99044a8b28b8631a27fc882a959f737f84)

src/lib/subs/attsub.c

index d3d6c5c3048a9f9f7a5e7e75ce0cba1e0a1030ec..75e86e3cd2abd0612d36198dbaea3e3131803924 100644 (file)
@@ -1230,11 +1230,8 @@ get_dlist(struct combat *def, struct emp_qelem *list, int a_spy,
            continue;
        if (def->type == EF_LAND && land.lnd_land != def->lnd_uid)
            continue;
-       if (!list) {            /* Just estimating the enemy strength */
-           intelligence_report(player->cnum, &land, a_spy,
-                               "Scouts report defending unit:");
-           continue;
-       }
+       intelligence_report(player->cnum, &land, a_spy,
+                           "Scouts report defending unit:");
        if (!(llp = malloc(sizeof(struct ulist)))) {
            logerror("Malloc failed in attack!\n");
            abort_attack();