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

@ -435,9 +435,6 @@ int
att_abort(int combat_mode, struct combat *off, struct combat *def)
{
struct sctstr sect;
int rel;
char y_or_n[512];
struct natstr *natp;
if (player->aborted)
return 1;
@ -513,23 +510,7 @@ att_abort(int combat_mode, struct combat *off, struct combat *def)
setcont(player->cnum, def->own, FOUND_SPY);
setcont(def->own, player->cnum, FOUND_SPY);
}
if (opt_SLOW_WAR && def->own != player->cnum) {
natp = getnatp(player->cnum);
rel = getrel(natp, def->own);
if (rel == ALLIED) {
sprintf(y_or_n, "Sector is owned by %s, your ally, %s [yn]? ",
cname(def->own), att_mode[combat_mode]);
if (!confirm(y_or_n))
return abort_attack();
}
if ((rel != AT_WAR) && (def->own) &&
(sect.sct_oldown != player->cnum)) {
pr("You're not at war with them!\n");
return abort_attack();
}
}
return 0;
}