]> git.pond.sub.org Git - empserver/commitdiff
Fix tend from target not to stop on foreign target
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 11 Jun 2012 17:39:23 +0000 (19:39 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 24 Jun 2012 06:45:55 +0000 (08:45 +0200)
Tending a negative number of commodities takes from the target ships.
When a target ship is foreign, tend silently stops.  This is wrong.
Fix it to skip foreign target ships instead.

Broken when Chainsaw 2 added tending to allies.

src/lib/commands/tend.c

index c462385855bd6174d99c715d3780fc0deb6d28e1..46eaeda39adc39db28389f0ab16e523b09d074ad 100644 (file)
@@ -30,7 +30,7 @@
  *     Dave Pare, 1986
  *     Thomas Ruschak, 1992
  *     Steve McClure, 2000
- *     Markus Armbruster, 2004-2011
+ *     Markus Armbruster, 2004-2012
  */
 
 #include <config.h>
@@ -148,10 +148,9 @@ tend(void)
            vbase = &mchr[(int)target.shp_type];
            maxtarget = vbase->m_item[ip->i_uid];
            if (amt < 0) {
-               if (!player->owner)
-                   amt = 0;
-
                /* take from target and give to tender */
+               if (!player->owner)
+                   continue;
                transfer = MIN(ontarget, -amt);
                transfer = MIN(maxtender - ontender, transfer);
                if (transfer == 0)