From 9df65336a92ef517d14a65bcba8f29d771cb3f7c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 28 May 2006 07:44:32 +0000 Subject: [PATCH] (landrepair): Simplify. --- src/lib/update/land.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/update/land.c b/src/lib/update/land.c index 5a6a22e9..e80e658a 100644 --- a/src/lib/update/land.c +++ b/src/lib/update/land.c @@ -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);