]> git.pond.sub.org Git - empserver/commitdiff
Fix mobility cost of automatic supply from remote sector
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 15 Feb 2009 13:20:12 +0000 (14:20 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Feb 2009 18:30:35 +0000 (19:30 +0100)
When a supply request got served completely from a remote sector after
some other source had already provided some of it, the sector was
charged mobility for the complete amount instead of just the part it
actually provided.

src/lib/subs/supply.c

index 5e55b5e38da67cca7f80bcb9ea12f4e0f9078a39..d6203a32c9ef83c975e0cf59d3cd7966366dbdd9 100644 (file)
@@ -202,7 +202,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
            sect.sct_item[type] -= wanted;
 
            /* take off mobility for delivering sect */
-           n = roundavg(total_wanted * weight * move_cost);
+           n = roundavg(wanted * weight * move_cost);
            if (n < 0)
                n = 0;
            if (n > sect.sct_mobil)