tend: Don't tend land units to multiple target ships

Each land unit is tended to each target ship in turn, and ends up on
the last one that can take it..  The load-tend test demonstrates this
with command "tend land 173 s 150/165":

    spy  infiltrator #320 transferred from sbc  cargo submarine (#173) to cs   cargo ship (#150)
    spy  infiltrator #320 transferred from sbc  cargo submarine (#173) to ls   landing ship (#165)
    spy  infiltrator #321 is not on sbc  cargo submarine (#173)!
    spy  infiltrator #322 transferred from sbc  cargo submarine (#173) to cs   cargo ship (#150)
    spy  infiltrator #322 transferred from sbc  cargo submarine (#173) to ls   landing ship (#165)

Has been that way ever since Empire 2 added tending of land units.

Fix by breaking tend_land()'s loop over all target ships after a
successful transfer.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-09-11 07:37:49 +02:00
parent 68945c8ff8
commit 3064731af4
4 changed files with 7 additions and 8 deletions

View file

@ -30,7 +30,7 @@
* Dave Pare, 1986
* Thomas Ruschak, 1992
* Steve McClure, 2000
* Markus Armbruster, 2004-2012
* Markus Armbruster, 2004-2017
*/
#include <config.h>
@ -280,6 +280,7 @@ tend_land(struct shpstr *tenderp, char *units)
expose_ship(tenderp, &target);
putship(target.shp_uid, &target);
putship(tenderp->shp_uid, tenderp);
break;
}
}
return 0;