]> git.pond.sub.org Git - empserver/commitdiff
Fix "sector can board" test to ignore land units on land units
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 16 Jul 2011 09:38:50 +0000 (11:38 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 16 Jul 2011 11:47:36 +0000 (13:47 +0200)
boar() lets a sector board if it has mobility or usable land units.
Embarked land units are not usable.  But it tests only "on ship", not
"on land unit".  Broken in 4.0.17.

src/lib/commands/boar.c

index b153153a66bb5c254069686b72d3220f584c3f61..c0dfafeca1c53356d437f92569615ab797075339 100644 (file)
@@ -90,7 +90,7 @@ boar(void)
            while (nxtitem(&ni, &land)) {
                if (land.lnd_own != player->cnum)
                    continue;
-               if (land.lnd_ship >= 0)
+               if (land.lnd_ship >= 0 || land.lnd_land >= 0)
                    continue;
                if (land.lnd_mobil <= 0)
                    continue;