(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:
Markus Armbruster 2004-03-04 13:49:25 +00:00
parent eccc5cb7d7
commit 5bad9875a5
11 changed files with 56 additions and 59 deletions

View file

@ -51,7 +51,6 @@ takeover(register struct sctstr *sp, natid newown)
struct plnstr *pp;
struct lndstr *lp;
int civ;
int che;
int che_count;
int oldche;
int n;
@ -116,7 +115,7 @@ takeover(register struct sctstr *sp, natid newown)
sp->sct_avail = 0;
civ = sp->sct_item[I_CIVIL];
oldche = get_che_value(sp->sct_che);
oldche = sp->sct_che;
/*
* create guerrillas from civilians
* how spunky are these guys?
@ -124,7 +123,6 @@ takeover(register struct sctstr *sp, natid newown)
*/
n = (50 - sp->sct_loyal) + ((random() % 100) - 25);
che_count = 0;
che = 0;
if (n > 0 && sp->sct_own == sp->sct_oldown) {
che_count = (civ * n / 3000) + 5;
if (che_count * 2 > civ)
@ -139,10 +137,9 @@ takeover(register struct sctstr *sp, natid newown)
che_count = oldche;
} else
che_count = oldche;
set_che_value(che, che_count);
sp->sct_che = che_count;
if (newown != sp->sct_oldown)
set_che_cnum(che, newown);
sp->sct_che = che;
sp->sct_che_target = newown;
sp->sct_item[I_CIVIL] = civ;
if (sp->sct_oldown == newown || civ == 0) {
/*