Skip to content

Commit

Permalink
Fix game saves not working
Browse files Browse the repository at this point in the history
  • Loading branch information
erysdren committed Aug 30, 2024
1 parent 80b8aa1 commit 7a86415
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions rott/rt_ted.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,29 @@ void GetMapFileName ( char * filename, size_t n )
strncpy(filename,src,n);
}

/*
======================
=
= GetMapFilePath
=
======================
*/
void GetMapFilePath ( char * filename, size_t n )
{
const char *src;

if (BATTLEMODE && BattleLevels.avail == true)
src = BattleLevels.file;
else if (GameLevels.avail == true)
src = GameLevels.file;
else if (BATTLEMODE)
src = BATTMAPS;
else
src = ROTTMAPS;

strncpy(filename,src,n);
}

/*
======================
=
Expand Down Expand Up @@ -1665,11 +1688,11 @@ unsigned short GetMapCRC

{
int filehandle;
char filename[ 80 ];
char filename[ 256 ];
RTLMAP RTLMap;
size_t mapsoffset;

GetMapFileName( &filename[ 0 ], sizeof(filename) );
GetMapFilePath( &filename[ 0 ], sizeof(filename) );
CheckRTLVersion( filename );
filehandle = SafeOpenRead( filename );
mapsoffset = GetMapArrayOffset( filehandle );
Expand Down

0 comments on commit 7a86415

Please sign in to comment.