# HG changeset patch # User John "Elwin" Edwards # Date 1375840978 25200 # Node ID f11eeafc656802738f7421b34a57478c7e143ce8 # Parent 0e212d46b68f9a1cde99e3c246a298b695c97b46 srogue: don't store machine-dependent metadata in the savefile. Super-Rogue, like Rogue V4, stored data of machine-dependent length in the savefile, to prevent cheating. This made saved games non-portable. Also deleted was a check that used this data, and prevented restoring savefiles from backup. This change BREAKS SAVEFILE COMPATIBILITY, but old files can be converted by removing the block at offset 0x1e with length sizeof(ino_t) + sizeof(dev_t) + 2 * sizeof(time_t). That seems to be 0x14 on i686 and 0x20 on x86_64. diff -r 0e212d46b68f -r f11eeafc6568 srogue/save.c --- a/srogue/save.c Mon Aug 05 20:49:41 2013 -0700 +++ b/srogue/save.c Tue Aug 06 19:02:58 2013 -0700 @@ -186,10 +186,6 @@ write(fnum, "RDK", 4); lseek(fnum, 0L, 0); encwrite(version,strlen(version)+1,savef); - encwrite(&sbuf.st_ino,sizeof(sbuf.st_ino),savef); - encwrite(&sbuf.st_dev,sizeof(sbuf.st_dev),savef); - encwrite(&sbuf.st_ctime,sizeof(sbuf.st_ctime),savef); - encwrite(&sbuf.st_mtime,sizeof(sbuf.st_mtime),savef); encwrite(&slines,sizeof(slines),savef); encwrite(&scols,sizeof(scols),savef); msg(""); @@ -238,10 +234,6 @@ fstat(inf, &sbuf2); - encread(&sbuf.st_ino,sizeof(sbuf.st_ino), inf); - encread(&sbuf.st_dev,sizeof(sbuf.st_dev), inf); - encread(&sbuf.st_ctime,sizeof(sbuf.st_ctime), inf); - encread(&sbuf.st_mtime,sizeof(sbuf.st_mtime), inf); encread(&slines,sizeof(slines),inf); encread(&scols,sizeof(scols),inf); @@ -250,14 +242,6 @@ * inode for as long as possible */ - if (!wizard) - { - if(sbuf2.st_ino!=sbuf.st_ino || sbuf2.st_dev!=sbuf.st_dev) { - printf("Sorry, saved game is not in the same file.\n"); - return FALSE; - } - } - #ifdef __INTERIX setenv("TERM","interix"); #endif