From e16fc41b2ed9007fce5386a97bfc24272214014f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 11 Jun 2012 19:48:36 +0200 Subject: [PATCH] Fix tend not to leak which commodities are loaded on friendlies Tending a negative number of commodities takes from the target ships. The target ships must be owned. Tend complains when the target doesn't have the commodity loaded. It does that even for friendly foreign ships. Don't. Broken when Chainsaw 2 added tending to allies. --- src/lib/commands/tend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/commands/tend.c b/src/lib/commands/tend.c index 46eaeda3..639a19d0 100644 --- a/src/lib/commands/tend.c +++ b/src/lib/commands/tend.c @@ -141,16 +141,16 @@ tend(void) tender.shp_y != target.shp_y) continue; ontarget = target.shp_item[ip->i_uid]; - if (ontarget == 0 && amt < 0) { - pr("No %s on %s\n", ip->i_name, prship(&target)); - continue; - } vbase = &mchr[(int)target.shp_type]; maxtarget = vbase->m_item[ip->i_uid]; if (amt < 0) { /* take from target and give to tender */ if (!player->owner) continue; + if (ontarget == 0) { + pr("No %s on %s\n", ip->i_name, prship(&target)); + continue; + } transfer = MIN(ontarget, -amt); transfer = MIN(maxtender - ontender, transfer); if (transfer == 0)