(sctstr): Member sct_che encoded number of che and their target.
Simplify. Split into member sct_che (number) and sct_che_target. Users changed. (get_che_cnum, set_che_cnum, get_che_value, get_che_value): Che encoding/decoding functions; remove. (CHE_MAX): Move from var.h to sect.h. (prsect, doland): Print / edit the new field.
This commit is contained in:
parent
eccc5cb7d7
commit
5bad9875a5
11 changed files with 56 additions and 59 deletions
|
@ -77,8 +77,8 @@ anti(void)
|
|||
pr(" ---- --------------------------\n");
|
||||
}
|
||||
mil = sect.sct_item[I_MILIT];
|
||||
che = get_che_value(sect.sct_che);
|
||||
target = get_che_cnum(sect.sct_che);
|
||||
che = sect.sct_che;
|
||||
target = sect.sct_che_target;
|
||||
avail_mil = sect.sct_mobil / 2;
|
||||
if (mil <= avail_mil)
|
||||
avail_mil = mil;
|
||||
|
@ -114,8 +114,8 @@ anti(void)
|
|||
sect.sct_mobil = sect.sct_mobil - chekilled - milkilled;
|
||||
sect.sct_item[I_MILIT] = mil - milkilled;
|
||||
if (ache == 0)
|
||||
sect.sct_che = 0;
|
||||
set_che_value(sect.sct_che, ache);
|
||||
sect.sct_che_target = 0;
|
||||
sect.sct_che = ache;
|
||||
putsect(§);
|
||||
pr(" Body count: Military %d - Guerillas %d.\n",
|
||||
milkilled, chekilled);
|
||||
|
@ -138,9 +138,11 @@ anti(void)
|
|||
/* Ok, now leave anywhere from 16% to 25% of the che */
|
||||
n_cheleft = (ache / (n_cheleft + 3));
|
||||
ache -= n_cheleft;
|
||||
set_che_value(sect.sct_che, n_cheleft);
|
||||
} else
|
||||
sect.sct_che = n_cheleft;
|
||||
} else {
|
||||
sect.sct_che = 0;
|
||||
sect.sct_che_target = 0;
|
||||
}
|
||||
sect.sct_item[I_MILIT] = ache;
|
||||
if (sect.sct_own == sect.sct_oldown)
|
||||
sect.sct_oldown = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue