]> git.pond.sub.org Git - empserver/blobdiff - src/lib/update/ship.c
Update copyright notice
[empserver] / src / lib / update / ship.c
index 54c18ec3388dbef81c60f0e50c407c2fd6765112..77a8816a1c24353ddad801059f6cb99c8ce65b58 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -31,7 +31,7 @@
  *     Dave Pare, 1986
  *     Steve McClure, 1996
  *     Ron Koenderink, 2004
- *     Markus Armbruster, 2006
+ *     Markus Armbruster, 2006-2007
  */
 
 #include <config.h>
@@ -156,7 +156,7 @@ upd_ship(struct shpstr *sp, int etus,
            sectp = getsectp(sp->shp_x, sp->shp_y);
 
            /* produce oil */
-           if (np->nat_money > 0
+           if (np->nat_money >= 0
                && (mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) {
                product = &pchr[dchr[SCT_OIL].d_prd];
                oil_gained = roundavg(total_work(100, etus,
@@ -182,7 +182,7 @@ upd_ship(struct shpstr *sp, int etus,
                sp->shp_item[I_OIL] += oil_gained;
            }
            /* produce fish */
-           if (np->nat_money > 0
+           if (np->nat_money >= 0
                && (mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) {
                sp->shp_item[I_FOOD]
                    += roundavg(total_work(100, etus,
@@ -303,7 +303,7 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
        if (!player->simulation)
            avail = wf + sp->sct_avail * 100;
        else
-           avail = wf + gt_bg_nmbr(bp, sp, I_MAX + 1) * 100;
+           avail = wf + bp_get_avail(bp, sp) * 100;
     }
 
     w_p_eff = SHP_BLD_WORK(mp->m_lcm, mp->m_hcm);
@@ -345,13 +345,13 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
        if (!player->simulation)
            avail = (sp->sct_avail * 100 + wf) / 100;
        else
-           avail = (gt_bg_nmbr(bp, sp, I_MAX + 1) * 100 + wf) / 100;
+           avail = (bp_get_avail(bp, sp) * 100 + wf) / 100;
        if (avail < 0)
            avail = 0;
        if (!player->simulation)
            sp->sct_avail = avail;
        else
-           pt_bg_nmbr(bp, sp, I_MAX + 1, avail);
+           bp_put_avail(bp, sp, avail);
     }
     if (sp->sct_type != SCT_HARBR)
        if ((build + ship->shp_effic) > 80) {