Remove option SLOW_WAR

SLOW_WAR has issues:

* The check whether the attacker old-owns the attacked sector is
  broken, because att_abort() uses sect.sct_oldown uninitialized.

  Spotted by the Clang Static Analyzer.

* Its implementation in setrel() is somewhat scary.  It's actually
  okay, because that part of setrel() only runs within decl().  Other
  callers don't reach it: update_main() because player->god != 0
  there, and the rest because they never pass a rel < HOSTILE.

* Documentation is a bit vague.

SLOW_WAR hasn't been used in a public game in years.  Fixing it is not
worth it, so remove it instead.
This commit is contained in:
Markus Armbruster 2011-01-09 19:03:38 +01:00
parent a94ae5f8c1
commit 439f111f98
23 changed files with 11 additions and 274 deletions

View file

@ -59,8 +59,7 @@ update_main(void)
int n;
int i;
struct bp *bp;
int cn, cn2, rel;
struct natstr *cnp;
int cn;
struct natstr *np;
logerror("production update (%d etus)", etu);
@ -130,26 +129,7 @@ update_main(void)
prod_nat(etu);
age_levels(etu);
free(bp);
if (opt_SLOW_WAR) {
/* Update war declarations */
/* MOBILIZATION->SITZKRIEG->AT_WAR */
for (cn = 1; cn < MAXNOC; cn++) {
if (!(cnp = getnatp(cn)))
break;
for (cn2 = 1; cn2 < MAXNOC; cn2++) {
if (cn2 == cn)
continue;
rel = getrel(cnp, cn2);
if (rel == MOBILIZATION) {
rel = SITZKRIEG;
setrel(cn, cn2, rel);
} else if (rel == SITZKRIEG) {
rel = AT_WAR;
setrel(cn, cn2, rel);
}
}
}
}
/* Only update mobility for non-MOB_ACCESS here, since it doesn't
get done for MOB_ACCESS anyway during the update */
if (!opt_MOB_ACCESS) {