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

@ -182,8 +182,6 @@ launch_missile(struct plnstr *pp)
struct mchrstr *mcp;
struct shpstr target_ship;
struct sctstr sect;
int rel;
struct natstr *natp;
struct nukstr nuke;
char buf[1024];
@ -230,18 +228,6 @@ launch_missile(struct plnstr *pp)
if (msl_equip(pp, 's') < 0)
return RET_FAIL;
getsect(sx, sy, &sect);
if (opt_SLOW_WAR) {
natp = getnatp(player->cnum);
rel = getrel(natp, sect.sct_own);
if ((rel != AT_WAR) && (sect.sct_own != player->cnum) &&
(sect.sct_own) && (sect.sct_oldown != player->cnum)) {
pr("You are not at war with the player->owner of the target sector!\n");
pr_beep();
pr("Kaboom!!!\n");
pr("Missile monitoring officer destroys RV before detonation.\n");
return RET_OK;
}
}
if (msl_launch(pp, EF_SECTOR, "sector", sx, sy, sect.sct_own,
&sublaunch) < 0)
return RET_OK;