tend: Report "cannot hold any" when tending to target, too

We report

    frg  frigate (#170) cannot hold any uncompensated workers

only when tending from target to tender, not for the other direction.
Report it there, too.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-09-15 16:51:46 +02:00
parent a0dc5cbf16
commit be5b167ce6
3 changed files with 6 additions and 1 deletions

View file

@ -227,6 +227,10 @@ tend_comm_to(struct shpstr *from, struct ichrstr *ip, int amt,
int can_take = to_max - to->shp_item[ip->i_uid]; int can_take = to_max - to->shp_item[ip->i_uid];
int transfer; int transfer;
if (!to_max) {
pr("%s cannot hold any %s\n", prship(to), ip->i_name);
return 0;
}
if (ip->i_uid == I_CIVIL && from->shp_own != to->shp_own) { if (ip->i_uid == I_CIVIL && from->shp_own != to->shp_own) {
pr("%s civilians refuse to board %s!\n", pr("%s civilians refuse to board %s!\n",
from->shp_own == player->cnum ? "Your" : "Foreign", from->shp_own == player->cnum ? "Your" : "Foreign",

View file

@ -85,7 +85,6 @@ tend h 151 -1 150/152
|| 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
tend u 170/171 -1 150 tend u 170/171 -1 150
| odd: only the second command reports "cannot hold"
| |
|| tend more than the tender has || tend more than the tender has
| #150 gives 7s, #152 gives 9s | #150 gives 7s, #152 gives 9s

View file

@ -2217,6 +2217,8 @@
Play#1 output Play#1 6 0 403 Play#1 output Play#1 6 0 403
Play#1 input tend u 150 1 170/171 Play#1 input tend u 150 1 170/171
Play#1 command tend Play#1 command tend
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 1 0 total uncompensated workers transferred off of cs cargo ship (#150) Play#1 output Play#1 1 0 total uncompensated workers transferred off of cs cargo ship (#150)
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