(do_mob_land): Fix to use all excess mobility for fortification, not
just up to the land unit's current mobility.
This commit is contained in:
parent
6ddbc9f950
commit
47e300b21e
1 changed files with 16 additions and 6 deletions
|
@ -400,11 +400,16 @@ do_mob_land(struct lndstr *lp, int etus)
|
||||||
if (opt_FUEL == 0) { /* just some bits and pieces */
|
if (opt_FUEL == 0) { /* just some bits and pieces */
|
||||||
value = lp->lnd_mobil + ((float)etus * land_mob_scale);
|
value = lp->lnd_mobil + ((float)etus * land_mob_scale);
|
||||||
if (value > land_mob_max) {
|
if (value > land_mob_max) {
|
||||||
|
/*
|
||||||
|
* provide mobility to be used in lnd_fortify()
|
||||||
|
* without overflowing lnd_mobil
|
||||||
|
*/
|
||||||
|
lp->lnd_mobil = land_mob_max;
|
||||||
if (!opt_MOB_ACCESS)
|
if (!opt_MOB_ACCESS)
|
||||||
lnd_fortify(lp, value - land_mob_max);
|
lnd_fortify(lp, value - land_mob_max);
|
||||||
value = land_mob_max;
|
lp->lnd_mobil = land_mob_max;
|
||||||
}
|
} else
|
||||||
lp->lnd_mobil = value;
|
lp->lnd_mobil = value;
|
||||||
|
|
||||||
return; /* Done! */
|
return; /* Done! */
|
||||||
}
|
}
|
||||||
|
@ -413,11 +418,16 @@ do_mob_land(struct lndstr *lp, int etus)
|
||||||
if (lp->lnd_fuelu == 0) {
|
if (lp->lnd_fuelu == 0) {
|
||||||
value = lp->lnd_mobil + ((float)etus * land_mob_scale);
|
value = lp->lnd_mobil + ((float)etus * land_mob_scale);
|
||||||
if (value > land_mob_max) {
|
if (value > land_mob_max) {
|
||||||
|
/*
|
||||||
|
* provide mobility to be used in lnd_fortify()
|
||||||
|
* without overflowing lnd_mobil
|
||||||
|
*/
|
||||||
|
lp->lnd_mobil = land_mob_max;
|
||||||
if (!opt_MOB_ACCESS)
|
if (!opt_MOB_ACCESS)
|
||||||
lnd_fortify(lp, value - land_mob_max);
|
lnd_fortify(lp, value - land_mob_max);
|
||||||
value = land_mob_max;
|
lp->lnd_mobil = land_mob_max;
|
||||||
}
|
} else
|
||||||
lp->lnd_mobil = value;
|
lp->lnd_mobil = value;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue