(do_mob_land): Disable automatic land unit fortification with excess
mobility when MOB_ACCESS is on. It leads to excessively deep recursion and thus miserable performance as the number of land units grows.
This commit is contained in:
parent
3e2cc8b746
commit
94af801449
1 changed files with 4 additions and 2 deletions
|
@ -400,7 +400,8 @@ 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) {
|
||||||
lnd_fortify(lp, value - land_mob_max);
|
if (!opt_MOB_ACCESS)
|
||||||
|
lnd_fortify(lp, value - land_mob_max);
|
||||||
value = land_mob_max;
|
value = land_mob_max;
|
||||||
}
|
}
|
||||||
lp->lnd_mobil = value;
|
lp->lnd_mobil = value;
|
||||||
|
@ -412,7 +413,8 @@ 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) {
|
||||||
lnd_fortify(lp, value - land_mob_max);
|
if (!opt_MOB_ACCESS)
|
||||||
|
lnd_fortify(lp, value - land_mob_max);
|
||||||
value = land_mob_max;
|
value = land_mob_max;
|
||||||
}
|
}
|
||||||
lp->lnd_mobil = value;
|
lp->lnd_mobil = value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue