Fix pak order when reconnecting to a server.

When /connect to the same server is issued while already connected, an initial call to CL_Disconnect will remove all pak file references
and reset the pak order.
Reordering only occurs through FS_Restart, which in turn is called when checksum feed changes. Because we reconnect to the same server,
checksum feed never changes and pak file order is not restored to server order again. With certain pak file constellations between client/server,
this may result in an inability to load files from paks which are not correctly detected as referenced paks.
This commit is contained in:
Thilo Schulz 2011-08-01 01:14:26 +00:00
parent e5ddcee71e
commit 8ab958fab9

View file

@ -3111,12 +3111,12 @@ static void FS_ReorderPurePaks( void )
searchpath_t **p_insert_index, // for linked list reordering searchpath_t **p_insert_index, // for linked list reordering
**p_previous; // when doing the scan **p_previous; // when doing the scan
fs_reordered = qfalse;
// only relevant when connected to pure server // only relevant when connected to pure server
if ( !fs_numServerPaks ) if ( !fs_numServerPaks )
return; return;
fs_reordered = qfalse;
p_insert_index = &fs_searchpaths; // we insert in order at the beginning of the list p_insert_index = &fs_searchpaths; // we insert in order at the beginning of the list
for ( i = 0 ; i < fs_numServerPaks ; i++ ) { for ( i = 0 ; i < fs_numServerPaks ; i++ ) {
p_previous = p_insert_index; // track the pointer-to-current-item p_previous = p_insert_index; // track the pointer-to-current-item
@ -3889,9 +3889,10 @@ qboolean FS_ConditionalRestart(int checksumFeed, qboolean disconnect)
Com_GameRestart(checksumFeed, disconnect); Com_GameRestart(checksumFeed, disconnect);
return qtrue; return qtrue;
} }
else if(checksumFeed != fs_checksumFeed) else if(checksumFeed != fs_checksumFeed)
FS_Restart(checksumFeed); FS_Restart(checksumFeed);
else if(fs_numServerPaks && !fs_reordered)
FS_ReorderPurePaks();
return qfalse; return qfalse;
} }