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.
This commit is contained in:
Markus Armbruster 2012-06-11 19:48:36 +02:00
parent 20b2598214
commit e16fc41b2e

View file

@ -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)