updating the FS on client disconnects

This commit is contained in:
myT 2018-01-29 20:28:37 +01:00
parent afe84395c5
commit c512071f2d
4 changed files with 12 additions and 7 deletions

View file

@ -21,6 +21,8 @@ chg: on Windows, a fatal error will move the early console window to the foregro
chg: com_hunkMegs doesn't have a maximum value anymore
a value too high would reset it and the engine might fail to load with the default value
fix: now updating the FS (connected to pure server, pak references) on client disconnects
fix: the condump command was truncating its file path argument to 64 characters
fix: "timedemo" playback runs at full speed again

View file

@ -783,6 +783,12 @@ void CL_Disconnect( qbool showMainMenu ) {
// not connected to a pure server anymore
cl_connectedToPureServer = qfalse;
// let the FS know we're not connected to a pure server
// and clear all pak references except to the game QVM
FS_PureServerSetLoadedPaks( "" );
FS_PureServerSetReferencedPaks( "", "" );
FS_ClearPakReferences( FS_CGAME_REF | FS_UI_REF | FS_GENERAL_REF );
// Stop recording any video
if( CL_VideoRecording( ) ) {
CL_CloseAVI( );

View file

@ -2892,9 +2892,6 @@ FS_ClearPakReferences
void FS_ClearPakReferences( int flags ) {
searchpath_t *search;
if ( !flags ) {
flags = -1;
}
for ( search = fs_searchpaths; search; search = search->next ) {
// is the element a pak file and has it been referenced?
if ( search->pack ) {
@ -3039,8 +3036,8 @@ void FS_Restart( int checksumFeed ) {
// set the checksum feed
fs_checksumFeed = checksumFeed;
// clear pak references
FS_ClearPakReferences(0);
// clear all pak references
FS_ClearPakReferences(-1);
// try to start up normally
FS_Startup( BASEGAME );

View file

@ -355,8 +355,8 @@ void SV_SpawnServer( const char* mapname )
}
}
// clear pak references
FS_ClearPakReferences(0);
// clear all pak references
FS_ClearPakReferences(-1);
// allocate the snapshot entities on the hunk
svs.snapshotEntities = (entityState_t*)Hunk_Alloc( sizeof(entityState_t)*svs.numSnapshotEntities, h_high );