Get rid of the need to fix up lchr[].
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.
This commit is contained in:
parent
91eefc3f3a
commit
3290e87576
4 changed files with 6 additions and 20 deletions
|
@ -172,7 +172,7 @@ lnd_take_casualty(int combat_mode, struct ulist *llp, int cas)
|
|||
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);
|
||||
}
|
||||
|
@ -274,7 +274,8 @@ lnd_take_casualty(int combat_mode, struct ulist *llp, int cas)
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue