]> git.pond.sub.org Git - empserver/commit
tend: Don't tend land units to multiple target ships
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 11 Sep 2017 05:37:49 +0000 (07:37 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:25:17 +0000 (07:25 +0100)
commit3064731af4fe3bc0df838e3414600c755feb0ac2
treea61baca570d0d5c5eabd57299cfd8ade118ddb13
parent68945c8ff86f40cbbfb11f11a7083aea221d96cd
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>
src/lib/commands/tend.c
tests/load-tend/03-tend-1
tests/load-tend/final.xdump
tests/load-tend/journal.log