From a0dc5cbf160d5d357c91ed9f19759efbfe0f1a06 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 15 Sep 2017 16:47:51 +0200 Subject: [PATCH] tend: Refuse to give away civilians more nicely Foreign target ships are silently ignored when tending civilians. This may leave the player guessing why the command did nothing. Report the reason similar to load does: Your civilians refuse to board cs cargo ship (#162)! Signed-off-by: Markus Armbruster --- src/lib/commands/tend.c | 6 +++++- tests/load-tend/journal.log | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/commands/tend.c b/src/lib/commands/tend.c index 8f205822..1679ca94 100644 --- a/src/lib/commands/tend.c +++ b/src/lib/commands/tend.c @@ -227,8 +227,12 @@ tend_comm_to(struct shpstr *from, struct ichrstr *ip, int amt, int can_take = to_max - to->shp_item[ip->i_uid]; int transfer; - 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", + from->shp_own == player->cnum ? "Your" : "Foreign", + prship(to)); return 0; + } if (!can_give) { pr("No %s on %s\n", ip->i_name, prship(from)); return 0; diff --git a/tests/load-tend/journal.log b/tests/load-tend/journal.log index a5d73971..fd61cec5 100644 --- a/tests/load-tend/journal.log +++ b/tests/load-tend/journal.log @@ -2173,6 +2173,8 @@ Play#1 input tend c 166 1 160/162/163/164 Play#1 command tend Play#1 output Play#1 1 You don't own ship #160! + Play#1 output Play#1 1 Your civilians refuse to board cs cargo ship (#162)! + Play#1 output Play#1 1 Your civilians refuse to board cs cargo ship (#163)! Play#1 output Play#1 1 You are not on friendly terms with the owner of ship #164! Play#1 output Play#1 1 0 total civilians transferred off of cs cargo ship (#166) Play#1 output Play#1 6 0 409 @@ -2474,11 +2476,13 @@ Play#0 input tend c 160/164 1 166 Play#0 command tend Play#0 output Play#0 1 You don't own ship #160! + Play#0 output Play#0 1 Foreign civilians refuse to board cs cargo ship (#166)! Play#0 output Play#0 1 0 total civilians transferred off of cs cargo ship (#164) Play#0 output Play#0 6 0 637 Play#0 input tend c 166 1 160/164 Play#0 command tend Play#0 output Play#0 1 You don't own ship #160! + Play#0 output Play#0 1 Foreign civilians refuse to board cs cargo ship (#164)! Play#0 output Play#0 1 0 total civilians transferred off of cs cargo ship (#166) Play#0 output Play#0 6 0 636 Play#0 input tend land 163/164 313/314 166