tend ltend: Improve "cannot hold any" message

Report the exact ship, like

    frg  frigate (#170) cannot hold any uncompensated workers

instead of reporting just the ship type, like

    A frg  frigate cannot hold any uncompensated workers

This is a bit more useful when tending to more than one ship.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-09-14 12:18:56 +02:00
parent f4dc2e1e79
commit 6035487287
3 changed files with 6 additions and 8 deletions

View file

@ -90,8 +90,7 @@ ltend(void)
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];
if (maxtender == 0) { if (maxtender == 0) {
pr("A %s cannot hold any %s\n", pr("%s cannot hold any %s\n", prship(&tender), ip->i_name);
mchr[(int)tender.shp_type].m_name, ip->i_name);
continue; continue;
} }
if (!snxtitem(&targets, EF_LAND, if (!snxtitem(&targets, EF_LAND,

View file

@ -124,8 +124,7 @@ tend(void)
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];
if (maxtender == 0) { if (maxtender == 0) {
pr("A %s cannot hold any %s\n", pr("%s cannot hold any %s\n", prship(&tender), ip->i_name);
mchr[(int)tender.shp_type].m_name, ip->i_name);
continue; continue;
} }
if (!snxtitem(&targets, EF_SHIP, if (!snxtitem(&targets, EF_SHIP,

View file

@ -2209,8 +2209,8 @@
Play#1 output Play#1 6 0 402 Play#1 output Play#1 6 0 402
Play#1 input tend u 170/171 -1 150 Play#1 input tend u 170/171 -1 150
Play#1 command tend Play#1 command tend
Play#1 output Play#1 1 A frg frigate cannot hold any uncompensated workers Play#1 output Play#1 1 frg frigate (#170) cannot hold any uncompensated workers
Play#1 output Play#1 1 A sb submarine cannot hold any uncompensated workers Play#1 output Play#1 1 sb submarine (#171) cannot hold any uncompensated workers
Play#1 output Play#1 6 0 401 Play#1 output Play#1 6 0 401
Play#1 input tend s 150/152 5 t Play#1 input tend s 150/152 5 t
Play#1 command tend Play#1 command tend
@ -2567,8 +2567,8 @@
Play#1 output Play#1 6 0 365 Play#1 output Play#1 6 0 365
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 A cs cargo ship cannot hold any iron ore Play#1 output Play#1 1 cs cargo ship (#200) cannot hold any iron ore
Play#1 output Play#1 1 A cs cargo ship cannot hold any iron ore Play#1 output Play#1 1 cs cargo ship (#201) cannot hold any iron ore
Play#1 output Play#1 6 0 364 Play#1 output Play#1 6 0 364
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