]> git.pond.sub.org Git - empserver/commitdiff
tend: Suppress "not on ship" unless land unit is selected by UID
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 12 Sep 2017 07:32:40 +0000 (09:32 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:25:17 +0000 (07:25 +0100)
The quickest way to tend all land units on a ship is to select all
land units with '*'.  However, tend then prints a "not on ship"
message for every land unit not on the tender, as the load-tend test
demonstrates.  Annoying.  Suppress this message unless the land unit
was explictly selected by UID.  Similar to how load and unload
suppress messages, only they get the condition wrong (to be fixed
soon).

A related annoyance remains, also visible in the load-tend test: tend
can still complain "not on ship" many times when tending explicitly
selected land units from multiple ships.

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

index d9482b22f19e544431e665383964544275bf53c3..a8d9c4b44108ccd45a9a8ecc4ae9f98fec9c92ad 100644 (file)
@@ -217,7 +217,8 @@ tend_land(struct shpstr *tenderp, char *units)
        if (!player->owner)
            continue;
        if (land.lnd_ship != tenderp->shp_uid) {
        if (!player->owner)
            continue;
        if (land.lnd_ship != tenderp->shp_uid) {
-           pr("%s is not on %s!\n", prland(&land), prship(tenderp));
+           if (lni.sel == NS_LIST)
+               pr("%s is not on %s!\n", prland(&land), prship(tenderp));
            continue;
        }
        if (!(lchr[(int)land.lnd_type].l_flags & L_ASSAULT)) {
            continue;
        }
        if (!(lchr[(int)land.lnd_type].l_flags & L_ASSAULT)) {
index ad756eba14313bc46f043831a625ea2dcd85a4af..9d012e0f7f696849da373cfa54a27605a2e57b2c 100644 (file)
@@ -152,14 +152,12 @@ tend land 151 301 0
 tend land 150 n 151
 | not capable: lacks assault (#300)
 tend land 150 * 151
 tend land 150 n 151
 | not capable: lacks assault (#300)
 tend land 150 * 151
-| usability: lots of useless "not on this ship" complaints
 | not on tender
 tend land 150 301 150
 | carrying civilians, to foreign ship
 | TODO need a land unit that can carry c to test this
 |
 || target's load limits
 | not on tender
 tend land 150 301 150
 | carrying civilians, to foreign ship
 | TODO need a land unit that can carry c to test this
 |
 || target's load limits
-| usability: lots of useless "not on this ship" complaints
 | can't carry non-light
 | TODO need a non-light assault land unit to test this
 | can't carry light (only spies)
 | can't carry non-light
 | TODO need a non-light assault land unit to test this
 | can't carry light (only spies)
@@ -168,6 +166,7 @@ tend land 151 301 171/173
 | TODO need a non-light assault land unit to test this
 | no room for light (transfers first 2)
 tend land t 301/302/303 170
 | TODO need a non-light assault land unit to test this
 | no room for light (transfers first 2)
 tend land t 301/302/303 170
+| usability: useless "not on this ship" complaints
 | no room for spy (transfers first 2)
 tend land 165 320/321/322 171
 tend land 165/171 s 173
 | no room for spy (transfers first 2)
 tend land 165 320/321/322 171
 tend land 165/171 s 173
index 49742005e84071ab60381681c6a7e65b0a81ddfd..ec0b183f57a825f378fe271ca1ac374a7656d31a 100644 (file)
     Play#1 output Play#1 6 0 388
     Play#1 input tend land 150 * 151
     Play#1 command tend
     Play#1 output Play#1 6 0 388
     Play#1 input tend land 150 * 151
     Play#1 command tend
-    Play#1 output Play#1 1 linf light infantry #0 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #1 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #2 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #3 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #4 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #5 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #6 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #7 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #8 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #9 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #10 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #11 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #12 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #13 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #14 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #15 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #16 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #17 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #18 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #19 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #20 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #21 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #22 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #23 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #24 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #25 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #30 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #31 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #32 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #33 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #34 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #35 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #50 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #51 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #52 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #53 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #54 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 sup  supply #80 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 sup  supply #81 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 sup  supply #82 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #100 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #105 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #110 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #115 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #120 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #121 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #122 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #123 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #124 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #125 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #126 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #127 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #128 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #129 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #130 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #131 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #132 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 rad  radar unit #133 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #140 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #141 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #142 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #143 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 hat  hvy artillery #150 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 hat  hvy artillery #151 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 hat  hvy artillery #152 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 tra  train #160 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #170 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #171 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #172 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #173 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #174 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #180 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #183 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #184 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #185 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #186 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #187 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #188 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #189 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #190 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #191 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #192 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #193 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #194 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #195 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #198 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #199 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #200 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #201 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #202 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #203 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #204 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #210 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #224 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #225 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #230 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #232 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #233 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #240 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #243 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #254 is not on cs   cargo ship (#150)!
     Play#1 output Play#1 1 sup  supply #300 does not have "assault" capability and can't be tended
     Play#1 output Play#1 1 sup  supply #300 does not have "assault" capability and can't be tended
-    Play#1 output Play#1 1 linf light infantry #301 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #302 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #303 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 hat  hvy artillery #304 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #315 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #316 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #317 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #320 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #321 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 spy  infiltrator #322 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #330 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 linf light infantry #331 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 sup  supply #350 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 sup  supply #351 is not on cs   cargo ship (#150)!
-    Play#1 output Play#1 1 sup  supply #352 is not on cs   cargo ship (#150)!
     Play#1 output Play#1 6 0 387
     Play#1 input tend land 150 301 150
     Play#1 command tend
     Play#1 output Play#1 6 0 387
     Play#1 input tend land 150 301 150
     Play#1 command tend
     Play#1 output Play#1 6 0 383
     Play#1 input tend land 165/171 s 173
     Play#1 command tend
     Play#1 output Play#1 6 0 383
     Play#1 input tend land 165/171 s 173
     Play#1 command tend
-    Play#1 output Play#1 1 spy  infiltrator #320 is not on ls   landing ship (#165)!
-    Play#1 output Play#1 1 spy  infiltrator #321 is not on ls   landing ship (#165)!
     Play#1 output Play#1 1 spy  infiltrator #322 transferred from ls   landing ship (#165) to sbc  cargo submarine (#173)
     Play#1 output Play#1 1 spy  infiltrator #320 transferred from sb   submarine (#171) to sbc  cargo submarine (#173)
     Play#1 output Play#1 1 sbc  cargo submarine (#173) doesn't have room for more than two spy units!
     Play#1 output Play#1 1 spy  infiltrator #322 transferred from ls   landing ship (#165) to sbc  cargo submarine (#173)
     Play#1 output Play#1 1 spy  infiltrator #320 transferred from sb   submarine (#171) to sbc  cargo submarine (#173)
     Play#1 output Play#1 1 sbc  cargo submarine (#173) doesn't have room for more than two spy units!
-    Play#1 output Play#1 1 spy  infiltrator #322 is not on sb   submarine (#171)!
     Play#1 output Play#1 6 0 382
     Play#1 input tend land 173 s 150/165
     Play#1 command tend
     Play#1 output Play#1 1 spy  infiltrator #320 transferred from sbc  cargo submarine (#173) to cs   cargo ship (#150)
     Play#1 output Play#1 6 0 382
     Play#1 input tend land 173 s 150/165
     Play#1 command tend
     Play#1 output Play#1 1 spy  infiltrator #320 transferred from sbc  cargo submarine (#173) to cs   cargo ship (#150)
-    Play#1 output Play#1 1 spy  infiltrator #321 is not on sbc  cargo submarine (#173)!
     Play#1 output Play#1 1 cs   cargo ship (#150) doesn't have room for any more land units!
     Play#1 output Play#1 1 spy  infiltrator #322 transferred from sbc  cargo submarine (#173) to ls   landing ship (#165)
     Play#1 output Play#1 6 0 381
     Play#1 output Play#1 1 cs   cargo ship (#150) doesn't have room for any more land units!
     Play#1 output Play#1 1 spy  infiltrator #322 transferred from sbc  cargo submarine (#173) to ls   landing ship (#165)
     Play#1 output Play#1 6 0 381