lboard: Don't permit boarding of embarked land units

You can board land units loaded on a ship or land unit.  This makes no
sense.  Reject attempts to board land units on a ship or land unit
exactly like attempts to board land units that don't exist.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-08-06 18:02:44 +02:00
parent 2315b50e52
commit 4c21c69acc

View file

@ -188,7 +188,8 @@ att_get_combat(struct combat *com, int isdef)
y = com->y; y = com->y;
break; break;
case EF_LAND: case EF_LAND:
if (!getland(com->lnd_uid, &land) || !land.lnd_own) { if (!getland(com->lnd_uid, &land) || !land.lnd_own
|| land.lnd_ship >= 0 || land.lnd_land >= 0) {
if (isdef) if (isdef)
pr("Land unit #%d is not in the same sector!\n", pr("Land unit #%d is not in the same sector!\n",
com->lnd_uid); com->lnd_uid);