]> git.pond.sub.org Git - empserver/commitdiff
Don't let non-light units board ships that can't carry them hvy-metal-2.5
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Jun 2008 18:16:27 +0000 (20:16 +0200)
committerMarkus Armbruster <armbru@pike.pond.sub.org>
Tue, 17 Jun 2008 18:20:02 +0000 (20:20 +0200)
ask_olist() let non-light land units board ships that can carry only
light units.  If the board succeeds, the non-light unit move onto the
ship and then are stuck there.
(cherry picked from commit 6d38a0493032b3b13adbbcbd07b65663e7368be3)

src/lib/subs/attsub.c

index 75e86e3cd2abd0612d36198dbaea3e3131803924..c2dacacfd81a746a0a1bb3ee9861c0a6365a7305 100644 (file)
@@ -1008,6 +1008,12 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
            pr("Land units are not able to board this kind of ship\n");
            return;
        }
+       if (def->type == EF_SHIP
+           && (def->shp_mcp->m_flags & (M_SUPPLY | M_SUB)) != M_SUPPLY
+           && !(lcp->l_flags & L_LIGHT)) {
+           pr("Only light land units can board this kind of ship\n");
+           continue;
+       }
        if (land.lnd_mobil <= 0) {
            pr("%s is out of mobility, and cannot %s\n",
               prland(&land), att_mode[combat_mode]);