update: Reorder ship, plane, land repair code for consistency

No functional change.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-05 15:00:42 +02:00
parent 6c4874e4d2
commit a5d90c0184
3 changed files with 31 additions and 36 deletions

View file

@ -194,28 +194,27 @@ upd_land(struct lndstr *lp, int etus,
static void
landrepair(struct lndstr *land, struct natstr *np, struct bp *bp, int etus)
{
struct lchrstr *lp = &lchr[(int)land->lnd_type];
int delta;
struct sctstr *sp;
struct lchrstr *lp;
int build;
int avail;
int mult;
lp = &lchr[(int)land->lnd_type];
if (land->lnd_effic == 100)
return;
sp = getsectp(land->lnd_x, land->lnd_y);
if (sp->sct_off)
return;
if (relations_with(sp->sct_own, land->lnd_own) != ALLIED)
return;
mult = 1;
if (np->nat_level[NAT_TLEV] < land->lnd_tech * 0.85)
mult = 2;
if (land->lnd_effic == 100) {
/* land is ok; no repairs needed */
return;
}
if (relations_with(sp->sct_own, land->lnd_own) != ALLIED)
return;
if (!player->simulation)
avail = sp->sct_avail * 100;
else