Skip to content

Commit c970f28

Browse files
committed
engine: fix Map_IsValid for mapcycle
1 parent d06435a commit c970f28

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

engine/modelloader.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5449,6 +5449,15 @@ bool CModelLoader::Map_IsValid( char const *pMapFile, bool bQuiet /* = false */
54495449
V_strcpy_safe( szMapFile, szMapName360 );
54505450
}
54515451

5452+
bool bHaveBspFormatInPath = strcasestr(szMapFile, ".bsp");
5453+
bool bHaveMapsInPath = strcasestr(szMapFile, "maps/");
5454+
5455+
if( !bHaveMapsInPath )
5456+
snprintf(szMapFile, sizeof(szMapFile), "maps/%s", pMapFile);
5457+
5458+
if( !bHaveBspFormatInPath )
5459+
strncat(szMapFile, ".bsp", sizeof(szMapFile));
5460+
54525461
mapfile = g_pFileSystem->OpenEx( szMapFile, "rb", IsX360() ? FSOPEN_NEVERINPACK : 0, "GAME" );
54535462
if ( mapfile != FILESYSTEM_INVALID_HANDLE )
54545463
{

0 commit comments

Comments
 (0)