]> git.pond.sub.org Git - empserver/commitdiff
tend ltend: Improve "cannot hold any" message
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Sep 2017 10:18:56 +0000 (12:18 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:25:17 +0000 (07:25 +0100)
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>
src/lib/commands/lten.c
src/lib/commands/tend.c
tests/load-tend/journal.log

index 1dbe216cbdbc23a690559c61049fb1da47b89729..0825ab73974841741abe469b9c1d0b3e73a7ece8 100644 (file)
@@ -90,8 +90,7 @@ ltend(void)
        vbase = &mchr[(int)tender.shp_type];
        maxtender = vbase->m_item[ip->i_uid];
        if (maxtender == 0) {
        vbase = &mchr[(int)tender.shp_type];
        maxtender = vbase->m_item[ip->i_uid];
        if (maxtender == 0) {
-           pr("A %s cannot hold any %s\n",
-              mchr[(int)tender.shp_type].m_name, ip->i_name);
+           pr("%s cannot hold any %s\n", prship(&tender), ip->i_name);
            continue;
        }
        if (!snxtitem(&targets, EF_LAND,
            continue;
        }
        if (!snxtitem(&targets, EF_LAND,
index 66aca256ee6aca70f0f25f28a03a4ea17af0af71..71d339f6977c66314533080f89d4c5634ab5920a 100644 (file)
@@ -124,8 +124,7 @@ tend(void)
        vbase = &mchr[(int)tender.shp_type];
        maxtender = vbase->m_item[ip->i_uid];
        if (maxtender == 0) {
        vbase = &mchr[(int)tender.shp_type];
        maxtender = vbase->m_item[ip->i_uid];
        if (maxtender == 0) {
-           pr("A %s cannot hold any %s\n",
-              mchr[(int)tender.shp_type].m_name, ip->i_name);
+           pr("%s cannot hold any %s\n", prship(&tender), ip->i_name);
            continue;
        }
        if (!snxtitem(&targets, EF_SHIP,
            continue;
        }
        if (!snxtitem(&targets, EF_SHIP,
index d3f6a03e611a443c34e913a6169a16d1a1db81ec..5379149965310ff7a24f8b4ae851e64d1d111d10 100644 (file)
     Play#1 output Play#1 6 0 402
     Play#1 input tend u 170/171 -1 150
     Play#1 command tend
     Play#1 output Play#1 6 0 402
     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 1 frg  frigate (#170) 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 input tend s 150/152 5 t
     Play#1 command tend
     Play#1 output Play#1 6 0 401
     Play#1 input tend s 150/152 5 t
     Play#1 command tend
     Play#1 output Play#1 6 0 365
     Play#1 input ltend i 200/201 -1 350/352
     Play#1 command ltend
     Play#1 output Play#1 6 0 365
     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 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 cs   cargo ship (#201) 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
     Play#1 output Play#1 6 0 364
     Play#1 input ltend c 200/201 -1 350/352
     Play#1 command ltend