]> git.pond.sub.org Git - empserver/commitdiff
Fix work command to round mobility use randomly, not down
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 3 Aug 2008 21:21:07 +0000 (17:21 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 12:40:04 +0000 (08:40 -0400)
src/lib/commands/work.c

index ba9022cfbc22a9e472ad854dd0f82b91f4fa774f..903717279e6cfd5f5f2ef201e406e0a87aa5c886 100644 (file)
@@ -28,7 +28,7 @@
  *  work.c: Implementation of the work command
  * 
  *  Known contributors to this file:
  *  work.c: Implementation of the work command
  * 
  *  Known contributors to this file:
- *   
+ *     Markus Armbruster, 2008
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -93,15 +93,14 @@ work(void)
            break;
        }
        player->dolcost += cost;
            break;
        }
        player->dolcost += cost;
-       eff_amt = ((6 * w) / (land.lnd_effic / 100.0));
        land.lnd_mission = 0;
        land.lnd_mission = 0;
-       land.lnd_mobil -= eff_amt;
+       land.lnd_mobil -= roundavg(w * 600.0 / land.lnd_effic);
        nunits++;
        pr("%s %s efficiency at %s to %d\n",
           prland(&land),
           sect.sct_type == sect.sct_newtype ? "raised" : "lowered",
           xyas(land.lnd_x, land.lnd_y, player->cnum),
        nunits++;
        pr("%s %s efficiency at %s to %d\n",
           prland(&land),
           sect.sct_type == sect.sct_newtype ? "raised" : "lowered",
           xyas(land.lnd_x, land.lnd_y, player->cnum),
-          (int)sect.sct_effic);
+          sect.sct_effic);
        putland(land.lnd_uid, &land);
        putsect(&sect);
     }
        putland(land.lnd_uid, &land);
        putsect(&sect);
     }