From 11a4fe42de7e3c05c85b9bfc048b06e91d1d6ce0 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 11 Oct 2024 22:35:38 -0700 Subject: [PATCH] 'selectsaved' again - update EDITLEVEL again The role, race, gender, and alignment string values are 3 letters preceded by a dash. I was looking at "name-race-role-gend-algn" and mistakenly treated them as 4 letters preceded by a dash. Fixing that changes PL_NSIZ_PLUS and there is one item of that size written into save files, so the fix invalidates existing save files. --- include/global.h | 2 +- include/patchlevel.h | 2 +- src/save.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/global.h b/include/global.h index 94e95370f..d2651b3b8 100644 --- a/include/global.h +++ b/include/global.h @@ -432,7 +432,7 @@ extern struct nomakedefs_s nomakedefs; #define PL_FSIZ 32 /* fruit name */ #define PL_PSIZ 63 /* player-given names for pets, other monsters, objects */ /* room for "name-role-race-gend-algn" plus 1 character playmode code */ -#define PL_NSIZ_PLUS (PL_NSIZ + 4 * (1 + 4) + 1) /* 53 */ +#define PL_NSIZ_PLUS (PL_NSIZ + 4 * (1 + 3) + 1) /* 49 */ #define MAXDUNGEON 16 /* current maximum number of dungeons */ #define MAXLEVEL 32 /* max number of levels in one dungeon */ diff --git a/include/patchlevel.h b/include/patchlevel.h index 1f9ae25b6..4d107d941 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 108 +#define EDITLEVEL 109 /* * Development status possibilities. diff --git a/src/save.c b/src/save.c index 09a0dedc4..509e3c437 100644 --- a/src/save.c +++ b/src/save.c @@ -1076,7 +1076,7 @@ savelevchn(NHFILE *nhfp) void store_plname_in_file(NHFILE *nhfp) { - char hero[PL_NSIZ_PLUS]; /* [PL_NSIZ + 4*4 + 1] */ + char hero[PL_NSIZ_PLUS]; /* [PL_NSIZ + 4*(1+3) + 1] */ int plsiztmp = (int) sizeof hero; (void) memset((genericptr_t) hero, '\0', sizeof hero);