diff --git a/rott/rt_ted.c b/rott/rt_ted.c index aa5724f..4a77e14 100644 --- a/rott/rt_ted.c +++ b/rott/rt_ted.c @@ -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); +} + /* ====================== = @@ -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 );