Don't let non-light units board ships that can't carry them

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 6d38a04930)
This commit is contained in:
Markus Armbruster 2008-06-17 20:16:27 +02:00 committed by Markus Armbruster
parent 0a7437bc43
commit 2b90a5230d

View 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"); pr("Land units are not able to board this kind of ship\n");
return; 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) { if (land.lnd_mobil <= 0) {
pr("%s is out of mobility, and cannot %s\n", pr("%s is out of mobility, and cannot %s\n",
prland(&land), att_mode[combat_mode]); prland(&land), att_mode[combat_mode]);