Mil are not required for building units since 4.0.0. l_mil was still
initialized to l_item[I_MILIT], and used instead of that in a couple
of places. Fix those, and remove the initialization.
char *l_name; /* full name of type of land unit */
int l_lcm; /* units of lcm to build */
int l_hcm; /* units of hcm to build */
char *l_name; /* full name of type of land unit */
int l_lcm; /* units of lcm to build */
int l_hcm; /* units of hcm to build */
- int l_mil; /* how many mil it takes to build */
+ int l_mil; /* how many mil it takes to build (unused) */
int l_gun; /* how many guns it takes to build (unused) */
int l_shell; /* #shells it takes to build (unused) */
int l_tech; /* tech required to build */
int l_gun; /* how many guns it takes to build (unused) */
int l_shell; /* #shells it takes to build (unused) */
int l_tech; /* tech required to build */
-#include "land.h"
-#include "misc.h"
#include "optlist.h"
#include "plane.h"
#include "product.h"
#include "optlist.h"
#include "plane.h"
#include "product.h"
static void init_mchr(void);
static void init_pchr(void);
static void init_plchr(void);
static void init_mchr(void);
static void init_pchr(void);
static void init_plchr(void);
-static void init_lchr(void);
init_pchr();
init_mchr();
init_plchr();
init_pchr();
init_mchr();
init_plchr();
-
-static void
-init_lchr()
-{
- int i;
-
- for (i = 0; lchr[i].l_name; i++) {
- /* Fix up the military values */
- lchr[i].l_mil = lchr[i].l_item[I_MILIT];
- }
-}
llp->unit.land.lnd_effic = 0;
} else {
eff_eq = ldround(cas * 100.0 /
llp->unit.land.lnd_effic = 0;
} else {
eff_eq = ldround(cas * 100.0 /
- ((struct lchrstr *)llp->chrp)->l_mil, 1);
+ ((struct lchrstr *)llp->chrp)->l_item[I_MILIT], 1);
llp->unit.land.lnd_effic -= eff_eq;
lnd_submil(&llp->unit.land, cas);
}
llp->unit.land.lnd_effic -= eff_eq;
lnd_submil(&llp->unit.land, cas);
}
if (nowhere_to_go) {
/* nowhere to go.. take more casualties */
llp->unit.land.lnd_effic -= 10;
if (nowhere_to_go) {
/* nowhere to go.. take more casualties */
llp->unit.land.lnd_effic -= 10;
- lnd_submil(&llp->unit.land, ((struct lchrstr *)llp->chrp)->l_mil / 10);
+ lnd_submil(&llp->unit.land,
+ ((struct lchrstr *)llp->chrp)->l_item[I_MILIT] / 10);
if (llp->unit.land.lnd_effic < LAND_MINEFF)
lnd_delete(llp, "has nowhere to retreat, and dies!");
else
if (llp->unit.land.lnd_effic < LAND_MINEFF)
lnd_delete(llp, "has nowhere to retreat, and dies!");
else
lp->lnd_effic -= deq;
lp->lnd_mobil -= deq / 2;
lp->lnd_effic -= deq;
lp->lnd_mobil -= deq / 2;
- deq = lchr[(int)lp->lnd_type].l_mil * (deq / 100.0);
+ deq = lchr[(int)lp->lnd_type].l_item[I_MILIT] * (deq / 100.0);
lnd_submil(lp, deq);
if (mc <= 0)
return;
lnd_submil(lp, deq);
if (mc <= 0)
return;
lp->lnd_effic -= deq;
lp->lnd_mobil -= deq / 2;
lp->lnd_effic -= deq;
lp->lnd_mobil -= deq / 2;
- deq = lchr[(int)lp->lnd_type].l_mil * (deq / 100.0);
+ deq = lchr[(int)lp->lnd_type].l_item[I_MILIT] * (deq / 100.0);
lnd_submil(lp, deq);
if (mc <= 0)
return;
lnd_submil(lp, deq);
if (mc <= 0)
return;