Fix: SE041 Problem: Record (& logfile) entries are in backwards compatible (3.2) format. topten.c needs updating to switch on 0.0.5->0.0.6 rather than the vanilla 3.2->3.3 code as at present. This causes problems when entering a graveyard level (What weird role is this?) Compatible with: Slash'EM 0.0.6E0 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 17 Jan 2000 *** src/topten.c.orig Mon Jan 17 13:30:14 2000 --- src/topten.c Mon Jan 17 19:38:37 2000 *************** *** 129,139 **** { #ifdef NO_SCAN_BRACK /* Version_ Pts DgnLevs_ Hp___ Died__Born id */ static const char *fmt = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d%*c"; ! static const char *fmt32 = "%c%c %s %s%*c"; static const char *fmt33 = "%s %s %s %s %s %s%*c"; #else static const char *fmt = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d "; ! static const char *fmt32 = "%c%c %[^,],%[^\n]%*c"; static const char *fmt33 = "%s %s %s %s %[^,],%[^\n]%*c"; #endif --- 129,139 ---- { #ifdef NO_SCAN_BRACK /* Version_ Pts DgnLevs_ Hp___ Died__Born id */ static const char *fmt = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d%*c"; ! static const char *fmt005 = "%s %c %s %s%*c"; static const char *fmt33 = "%s %s %s %s %s %s%*c"; #else static const char *fmt = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d "; ! static const char *fmt005 = "%s %c %[^,],%[^\n]%*c"; static const char *fmt33 = "%s %s %s %s %[^,],%[^\n]%*c"; #endif *************** *** 152,166 **** tt->points = 0; else { /* Check for backwards compatibility */ ! if (tt->ver_major < 3 || ! (tt->ver_major == 3 && tt->ver_minor < 3)) { int i; ! if (fscanf(rfile, fmt32, tt->plrole, tt->plgend, tt->name, tt->death) != 4) tt->points = 0; - tt->plrole[1] = 0; if ((i = str2role(tt->plrole)) >= 0) (void) strncpy(tt->plrole, roles[i].filecode, ROLESZ); tt->plrole[ROLESZ] = 0; --- 152,164 ---- tt->points = 0; else { /* Check for backwards compatibility */ ! if (!tt->ver_major && !tt->ver_minor && tt->patchlevel < 6) { int i; ! if (fscanf(rfile, fmt005, tt->plrole, tt->plgend, tt->name, tt->death) != 4) tt->points = 0; if ((i = str2role(tt->plrole)) >= 0) (void) strncpy(tt->plrole, roles[i].filecode, ROLESZ); tt->plrole[ROLESZ] = 0; *************** *** 203,216 **** tt->points, tt->deathdnum, tt->deathlev, tt->maxlvl, tt->hp, tt->maxhp, tt->deaths, tt->deathdate, tt->birthdate, tt->uid); ! if (tt->ver_major < 3 || ! (tt->ver_major == 3 && tt->ver_minor < 3)) #ifdef NO_SCAN_BRACK ! (void) fprintf(rfile,"%c%c %s %s\n", #else ! (void) fprintf(rfile,"%c%c %s,%s\n", #endif ! tt->plrole[0], tt->plgend[0], onlyspace(tt->name) ? "_" : tt->name, tt->death); else #ifdef NO_SCAN_BRACK --- 201,213 ---- tt->points, tt->deathdnum, tt->deathlev, tt->maxlvl, tt->hp, tt->maxhp, tt->deaths, tt->deathdate, tt->birthdate, tt->uid); ! if (!tt->ver_major && !tt->ver_minor && tt->patchlevel < 6) #ifdef NO_SCAN_BRACK ! (void) fprintf(rfile,"%s %c %s %s\n", #else ! (void) fprintf(rfile,"%s %c %s,%s\n", #endif ! tt->plrole, tt->plgend[0], onlyspace(tt->name) ? "_" : tt->name, tt->death); else #ifdef NO_SCAN_BRACK