From: Markus Armbruster Date: Mon, 19 Sep 2016 18:35:30 +0000 (+0200) Subject: subs/control: Fix to ignore embarked land units X-Git-Tag: v4.4.0~100 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=19656b892b86a1de4221defa1b4701134f68e503 subs/control: Fix to ignore embarked land units Moving stuff out of an occupied sector generally requires "military control", i.e. you need at least one military for every ten civilians. Military in land units count. Even when the land unit is loaded on a ship or land unit. Questionable, because unload need not be possible. Checking whether unload would be possible is not worth the trouble here, simply ignore embarked land units. This affects commands move, explore, sell, set and transport, as well as the update's distribution and delivery. Signed-off-by: Markus Armbruster --- diff --git a/src/lib/subs/control.c b/src/lib/subs/control.c index c5f083e02..a067dae7d 100644 --- a/src/lib/subs/control.c +++ b/src/lib/subs/control.c @@ -85,6 +85,8 @@ military_control(struct sctstr *sp) if (sp->sct_oldown != sp->sct_own) { snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y); while (nxtitem(&ni, &land)) { + if (land.lnd_ship >= 0 || land.lnd_land >= 0) + continue; if (land.lnd_own == sp->sct_own) tot_mil += land.lnd_item[I_MILIT]; }