]> git.pond.sub.org Git - empserver/commitdiff
Fix fly and drop to report discarded cargo items correctly
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Apr 2010 16:36:55 +0000 (18:36 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 9 May 2010 07:08:03 +0000 (09:08 +0200)
When d of n cargo items are discarded for want of space, pln_dropoff()
reported -d items discarded and -d items unloaded.  Already broken in
BSD Empire 1.1.

src/lib/subs/plnsub.c

index 5e11ec05e2f3f8c907297a100eac7036e835cc54..0367d77d63a53f5f381d33256436c191e256d86c 100644 (file)
@@ -305,8 +305,8 @@ pln_dropoff(struct emp_qelem *list, struct ichrstr *ip, coord tx, coord ty,
     }
     there += amt;
     if (there > max) {
-       pr("%d excess %s discarded\n", max - there, ip->i_name);
-       amt = max - there;
+       pr("%d excess %s discarded\n", there - max, ip->i_name);
+       amt -= there - max;
        there = max;
     }
     pr("%d %s landed safely", amt, ip->i_name);