]> git.pond.sub.org Git - empserver/commitdiff
Fix work command not to spend more mobility than requested
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 3 Aug 2008 21:20:05 +0000 (17:20 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 12:40:04 +0000 (08:40 -0400)
Culprit is careless rounding in work().

src/lib/commands/work.c

index 8ab3780649f7cc22c8be6508d3d8ce6220e3dc98..ba9022cfbc22a9e472ad854dd0f82b91f4fa774f 100644 (file)
@@ -79,7 +79,7 @@ work(void)
            continue;
        }
        eff_amt = MIN(land.lnd_mobil, work_amt);
-       w = ldround(((double)eff_amt * land.lnd_effic / 600.0), 1);
+       w = (eff_amt * land.lnd_effic) / 600;
        if (w < 1) {
            pr("%s doesn't work enough to change efficiency (try increasing amount)\n",
               prland(&land));