(FALLOUT_MAX): New.
(doland, detonate, spread_fallout): Use it. With variables, fallout beyond the capacity of variables (65535) was ignored, except in doland(), where it saturated at 9999, and spread_fallout, where it could overflow. Now it always saturates at FALLOUT_MAX.
This commit is contained in:
parent
828b84d840
commit
abd1fd2c1e
4 changed files with 6 additions and 5 deletions
|
@ -307,7 +307,7 @@ spread_fallout(struct sctstr *sp, int etus)
|
|||
#endif
|
||||
if (inc < 0)
|
||||
inc = 0;
|
||||
ap->sct_fallout += inc;
|
||||
ap->sct_fallout = min(ap->sct_fallout + inc, FALLOUT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -327,8 +327,7 @@ decay_fallout(struct sctstr *sp, int etus)
|
|||
sp->sct_y, decay, sp->sct_fallout);
|
||||
#endif
|
||||
|
||||
sp->sct_fallout =
|
||||
(decay < sp->sct_fallout) ? (sp->sct_fallout - decay) : 0;
|
||||
sp->sct_fallout = decay < sp->sct_fallout ? sp->sct_fallout - decay : 0;
|
||||
}
|
||||
|
||||
#define SHOULD_PRODUCE(sp,t) (((sp->sct_type == t) || (t == -1)) ? 1 : 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue