]> git.pond.sub.org Git - empserver/commitdiff
Fix bogus message when deity attempts to march foreign land unit
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Jun 2010 15:59:49 +0000 (17:59 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Jul 2010 06:31:20 +0000 (08:31 +0200)
Much of the code assumes that only the land unit's owner can march it.
The assumption is correct, because lnd_mar() leaves foreign land units
behind with a bogus "was disbanded at" message (suppressed for country

It would be nice to let deities march foreign land units, but the
assumption is not trivial to remove.  For now, just avoid the bogus
message.

Historical note: it looks like deities used to be able to march
foreign land units just fine until Empire 2 factored common code out
of navigate, sail and autonav, and updated march to match navigate.
Likewise, it looks like they could board with foreign land units until
Empire 2 factored out common ground combat code.  Commands attack and
assault have always rejected foreign land units, even for deities.

src/lib/subs/lndsub.c

index 060019e46d56c3491bfa70186a0b91a533a01220..e5b563d72d914cbc904c6983c280f7a84b48a31e 100644 (file)
@@ -404,7 +404,12 @@ lnd_sel(struct nstr_item *ni, struct emp_qelem *list)
 
     emp_initque(list);
     while (nxtitem(ni, &land)) {
-       if (!player->owner)
+       /*
+        * It would be nice to let deities march foreign land units,
+        * but much of the code assumes that only the land unit's
+        * owner can march it.
+        */
+       if (land.lnd_own != player->cnum)
            continue;
        if (opt_MARKET) {
            if (ontradingblock(EF_LAND, &land)) {