]> git.pond.sub.org Git - empserver/commitdiff
(landrepair): Simplify.
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 May 2006 07:44:32 +0000 (07:44 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 May 2006 07:44:32 +0000 (07:44 +0000)
src/lib/update/land.c

index 5a6a22e9280a5d8d810273f2c191f114c58f851b..e80e658abb84be673a508ee7d934155903208dca 100644 (file)
@@ -317,15 +317,12 @@ landrepair(struct lndstr *land, struct natstr *np, int *bp, int etus)
        build /= 3;
 
     avail -= build * w_p_eff;
-    if (!player->simulation) {
+    if (avail < 0)
+       avail = 0;
+    if (!player->simulation)
        sp->sct_avail = avail / 100;
-       if (sp->sct_avail < 0)
-           sp->sct_avail = 0;
-    } else {
+    else
        pt_bg_nmbr(bp, sp, I_MAX + 1, avail / 100);
-       if (gt_bg_nmbr(bp, sp, I_MAX + 1) < 0)
-           pt_bg_nmbr(bp, sp, I_MAX + 1, 0);
-    }
 
     if (build < 0)
        logerror("land unit %d building %d ! \n", land->lnd_uid, build);