tend ltend: Handle "don't have commodity" consistently

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>
This commit is contained in:
Markus Armbruster 2017-09-14 12:10:07 +02:00
parent 1bde4df2bd
commit 3dc22e8497
4 changed files with 6 additions and 7 deletions

View file

@ -85,7 +85,7 @@ ltend(void)
ontender = tender.shp_item[ip->i_uid]; ontender = tender.shp_item[ip->i_uid];
if (ontender == 0 && amt > 0) { if (ontender == 0 && amt > 0) {
pr("No %s on %s\n", ip->i_name, prship(&tender)); pr("No %s on %s\n", ip->i_name, prship(&tender));
return RET_FAIL; continue;
} }
vbase = &mchr[(int)tender.shp_type]; vbase = &mchr[(int)tender.shp_type];
maxtender = vbase->m_item[ip->i_uid]; maxtender = vbase->m_item[ip->i_uid];

View file

@ -119,7 +119,7 @@ tend(void)
ontender = tender.shp_item[ip->i_uid]; ontender = tender.shp_item[ip->i_uid];
if (ontender == 0 && amt > 0) { if (ontender == 0 && amt > 0) {
pr("No %s on %s\n", ip->i_name, prship(&tender)); pr("No %s on %s\n", ip->i_name, prship(&tender));
return RET_FAIL; continue;
} }
vbase = &mchr[(int)tender.shp_type]; vbase = &mchr[(int)tender.shp_type];
maxtender = vbase->m_item[ip->i_uid]; maxtender = vbase->m_item[ip->i_uid];

View file

@ -82,7 +82,6 @@ tend h 150 -1 170/171
|| tend something the tender doesn't have || tend something the tender doesn't have
tend h 150/152 1 151 tend h 150/152 1 151
tend h 151 -1 150/152 tend h 151 -1 150/152
| odd: first command fails, second doesn't
| |
|| tend something the target can't hold || tend something the target can't hold
tend u 150 1 170/171 tend u 150 1 170/171

View file

@ -2184,7 +2184,7 @@
Play#1 input tend h 170/171 1 150 Play#1 input tend h 170/171 1 150
Play#1 command tend Play#1 command tend
Play#1 output Play#1 1 No heavy products on frg frigate (#170) 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 output Play#1 6 0 406
Play#1 input tend h 150 -1 170/171 Play#1 input tend h 150 -1 170/171
Play#1 command tend Play#1 command tend
@ -2195,7 +2195,7 @@
Play#1 input tend h 150/152 1 151 Play#1 input tend h 150/152 1 151
Play#1 command tend Play#1 command tend
Play#1 output Play#1 1 No heavy products on cs cargo ship (#150) 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 output Play#1 6 0 404
Play#1 input tend h 151 -1 150/152 Play#1 input tend h 151 -1 150/152
Play#1 command tend Play#1 command tend
@ -2532,7 +2532,7 @@
Play#1 input ltend i 200/201 1 350/352 Play#1 input ltend i 200/201 1 350/352
Play#1 command ltend Play#1 command ltend
Play#1 output Play#1 1 No iron ore on cs cargo ship (#200) 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 output Play#1 6 0 370
Play#1 input ltend c 200/201 1 350/352 Play#1 input ltend c 200/201 1 350/352
Play#1 command ltend Play#1 command ltend
@ -2544,7 +2544,7 @@
Play#1 input ltend h 200/201 1 350/352 Play#1 input ltend h 200/201 1 350/352
Play#1 command ltend Play#1 command ltend
Play#1 output Play#1 1 No heavy products on cs cargo ship (#200) 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 output Play#1 6 0 368
Play#1 input ltend f 200/201 0 350/351//352 Play#1 input ltend f 200/201 0 350/351//352
Play#1 command ltend Play#1 command ltend