]> git.pond.sub.org Git - empserver/commitdiff
tend ltend: Handle "cannot hold commodity" consistently
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Sep 2017 10:14:14 +0000 (12:14 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:25:17 +0000 (07:25 +0100)
Transferring commodities from tenders to targets continues with the
next tender when a target can't hold this kind of commodity.
Transferring them from targets to tenders fails (ltend) or stops
tending (tend) when a tender can't hold this kind of commodity.  Has
always been that way.

Change the latter to continue with the next tender.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/lten.c
src/lib/commands/tend.c
tests/load-tend/journal.log

index 3cbc4ada6a2a625121220069ed0b2f38fd6a3451..1dbe216cbdbc23a690559c61049fb1da47b89729 100644 (file)
@@ -92,7 +92,7 @@ ltend(void)
        if (maxtender == 0) {
            pr("A %s cannot hold any %s\n",
               mchr[(int)tender.shp_type].m_name, ip->i_name);
-           return RET_FAIL;
+           continue;
        }
        if (!snxtitem(&targets, EF_LAND,
                      player->argp[4], "Units to be tended? "))
index deec23a47d63443ace5673cb1ebffa13c801071e..66aca256ee6aca70f0f25f28a03a4ea17af0af71 100644 (file)
@@ -126,7 +126,7 @@ tend(void)
        if (maxtender == 0) {
            pr("A %s cannot hold any %s\n",
               mchr[(int)tender.shp_type].m_name, ip->i_name);
-           break;
+           continue;
        }
        if (!snxtitem(&targets, EF_SHIP,
                      player->argp[4], "Ships to be tended? "))
index b051b0e2f433d2569ee1e4a7c2d6b0c8674b98c8..d3f6a03e611a443c34e913a6169a16d1a1db81ec 100644 (file)
     Play#1 input tend u 170/171 -1 150
     Play#1 command tend
     Play#1 output Play#1 1 A frg  frigate cannot hold any uncompensated workers
+    Play#1 output Play#1 1 A sb   submarine cannot hold any uncompensated workers
     Play#1 output Play#1 6 0 401
     Play#1 input tend s 150/152 5 t
     Play#1 command tend
     Play#1 input ltend i 200/201 -1 350/352
     Play#1 command ltend
     Play#1 output Play#1 1 A cs   cargo ship cannot hold any iron ore
-    Play#1 output Play#1 1 command failed
+    Play#1 output Play#1 1 A cs   cargo ship cannot hold any iron ore
     Play#1 output Play#1 6 0 364
     Play#1 input ltend c 200/201 -1 350/352
     Play#1 command ltend