From fab39a2007b1d5e05ee2550b95abc67e93cd1546 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 15 Aug 2002 02:48:34 +0000 Subject: [PATCH] compatibility checks fix for TIMED_DELAY makedefs has been listing TIMED_DELAY as one of the options which affects save file contents even though that hasn't been the case for a long time. Unfortunately, simply fixing that by itself would break save file compatibility for anyone who has been building with it set. This workaround prevents the fix from doing that. And now folks can rebuild after toggling TIMED_DELAY without unnecessarily invalidating save and bones files. --- doc/fixes34.1 | 1 + src/version.c | 10 ++++++++-- util/makedefs.c | 21 +++++++++++++++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 8c8576903..7fe5b8c27 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -206,6 +206,7 @@ engulfing green slime as a purple worm was causing stoning not sliming zero entries in DUNGEON, MONSTERS, et al, of config file are now treated as preserving the default rather than being ignored enlightenment: don't misreport polymorphed lycanthrope as "in beast form" +remove TIMED_DELAY from the features checked for version compatibility Platform- and/or Interface-Specific Fixes diff --git a/src/version.c b/src/version.c index 02f577ec7..669d22d9c 100644 --- a/src/version.c +++ b/src/version.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)version.c 3.4 1999/12/01 */ +/* SCCS Id: @(#)version.c 3.4 2002/08/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -64,7 +64,13 @@ boolean complain; if (complain) pline("Version mismatch for file \"%s\".", filename); return FALSE; - } else if (version_data->feature_set != VERSION_FEATURES || + } else if ( +#ifndef IGNORED_FEATURES + version_data->feature_set != VERSION_FEATURES || +#else + (version_data->feature_set & ~IGNORED_FEATURES) != + (VERSION_FEATURES & ~IGNORED_FEATURES) || +#endif version_data->entity_count != VERSION_SANITY1 || version_data->struct_sizes != VERSION_SANITY2) { if (complain) diff --git a/util/makedefs.c b/util/makedefs.c index 46c21c2f8..0c27da698 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)makedefs.c 3.4 2002/03/03 */ +/* SCCS Id: @(#)makedefs.c 3.4 2002/08/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ /* Copyright (c) Dean Luick, 1990. */ @@ -406,6 +406,18 @@ do_rumors() return; } +/* + * 3.4.1: way back in 3.2.1 `flags.nap' became unconditional but + * TIMED_DELAY was erroneously left in VERSION_FEATURES and has + * been there up through 3.4.0. Simply removing it now would + * break save file compatibility with 3.4.0 files, so we will + * explicitly mask it out during version checks. + * This should go away in the next version update. + */ +#define IGNORED_FEATURES ( 0L \ + | (1L << 23) /* TIMED_DELAY */ \ + ) + static void make_version() { @@ -465,9 +477,6 @@ make_version() #endif #ifdef SCORE_ON_BOTL | (1L << 21) -#endif -#ifdef TIMED_DELAY - | (1L << 23) #endif /* data format [COMPRESS excluded] (27..31) */ #ifdef ZEROCOMP @@ -569,6 +578,10 @@ do_date() version.incarnation, ul_sfx); Fprintf(ofp,"#define VERSION_FEATURES 0x%08lx%s\n", version.feature_set, ul_sfx); +#ifdef IGNORED_FEATURES + Fprintf(ofp,"#define IGNORED_FEATURES 0x%08lx%s\n", + (unsigned long) IGNORED_FEATURES, ul_sfx); +#endif Fprintf(ofp,"#define VERSION_SANITY1 0x%08lx%s\n", version.entity_count, ul_sfx); Fprintf(ofp,"#define VERSION_SANITY2 0x%08lx%s\n",