Replace common pattern by new LIMIT_TO()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
aa870f5d91
commit
726b9380d1
11 changed files with 73 additions and 162 deletions
|
@ -102,11 +102,7 @@ populace(struct natstr *np, struct sctstr *sp, int etu)
|
|||
n -= roundavg(etu * 0.25);
|
||||
else
|
||||
n += roundavg(etu * 0.125);
|
||||
if (n < 0)
|
||||
n = 0;
|
||||
else if (n > 127)
|
||||
n = 127;
|
||||
sp->sct_loyal = n;
|
||||
sp->sct_loyal = LIMIT_TO(n, 0, 127);
|
||||
if (sp->sct_loyal == 0) {
|
||||
if (sp->sct_oldown != sp->sct_own) {
|
||||
wu(0, sp->sct_own,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue