Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix game saves not working at all #88

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading