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

Change the former 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/03-tend-1
tests/load-tend/journal.log

index f5df960d6e2f3e85af67d62233a967b5269286b2..3cbc4ada6a2a625121220069ed0b2f38fd6a3451 100644 (file)
@@ -85,7 +85,7 @@ ltend(void)
        ontender = tender.shp_item[ip->i_uid];
        if (ontender == 0 && amt > 0) {
            pr("No %s on %s\n", ip->i_name, prship(&tender));
-           return RET_FAIL;
+           continue;
        }
        vbase = &mchr[(int)tender.shp_type];
        maxtender = vbase->m_item[ip->i_uid];
index 25a054dc5c2f807310e40298b353cf007b571af0..deec23a47d63443ace5673cb1ebffa13c801071e 100644 (file)
@@ -119,7 +119,7 @@ tend(void)
        ontender = tender.shp_item[ip->i_uid];
        if (ontender == 0 && amt > 0) {
            pr("No %s on %s\n", ip->i_name, prship(&tender));
-           return RET_FAIL;
+           continue;
        }
        vbase = &mchr[(int)tender.shp_type];
        maxtender = vbase->m_item[ip->i_uid];
index c51b8d81955f9e43358fa41d39732376e580c0fd..a9f83e25feeb6be067e56f1fb26d5cea326f6b52 100644 (file)
@@ -82,7 +82,6 @@ tend h 150 -1 170/171
 || tend something the tender doesn't have
 tend h 150/152 1 151
 tend h 151 -1 150/152
-| odd: first command fails, second doesn't
 |
 || tend something the target can't hold
 tend u 150 1 170/171
index c5f61807d0230d8c093e3c68bd3d08584d3b0496..b051b0e2f433d2569ee1e4a7c2d6b0c8674b98c8 100644 (file)
     Play#1 input tend h 170/171 1 150
     Play#1 command tend
     Play#1 output Play#1 1 No heavy products on frg  frigate (#170)
-    Play#1 output Play#1 1 command failed
+    Play#1 output Play#1 1 No heavy products on sb   submarine (#171)
     Play#1 output Play#1 6 0 406
     Play#1 input tend h 150 -1 170/171
     Play#1 command tend
     Play#1 input tend h 150/152 1 151
     Play#1 command tend
     Play#1 output Play#1 1 No heavy products on cs   cargo ship (#150)
-    Play#1 output Play#1 1 command failed
+    Play#1 output Play#1 1 No heavy products on cs   cargo ship (#152)
     Play#1 output Play#1 6 0 404
     Play#1 input tend h 151 -1 150/152
     Play#1 command tend
     Play#1 input ltend i 200/201 1 350/352
     Play#1 command ltend
     Play#1 output Play#1 1 No iron ore on cs   cargo ship (#200)
-    Play#1 output Play#1 1 command failed
+    Play#1 output Play#1 1 No iron ore on cs   cargo ship (#201)
     Play#1 output Play#1 6 0 370
     Play#1 input ltend c 200/201 1 350/352
     Play#1 command ltend
     Play#1 input ltend h 200/201 1 350/352
     Play#1 command ltend
     Play#1 output Play#1 1 No heavy products on cs   cargo ship (#200)
-    Play#1 output Play#1 1 command failed
+    Play#1 output Play#1 1 No heavy products on cs   cargo ship (#201)
     Play#1 output Play#1 6 0 368
     Play#1 input ltend f 200/201 0 350/351//352
     Play#1 command ltend