/* ===================== CL_Disconnect Called when a connection, or cinematic is being terminated. Goes from a connected state to either a menu state or a console state Sends a disconnect message to the server This is also called on Com_Error and Com_Quit, so it shouldn't cause any errors ===================== */ void CL_Disconnect( void ) { if ( !com_cl_running || !com_cl_running->integer ) { return; } if (cls.uiStarted) UI_SetActiveMenu( NULL,NULL ); SCR_StopCinematic (); S_ClearSoundBuffer(); // send a disconnect message to the server // send it a few times in case one is dropped if ( cls.state >= CA_CONNECTED ) { CL_AddReliableCommand( "disconnect" ); CL_WritePacket(); CL_WritePacket(); CL_WritePacket(); } CL_ClearState (); CL_FreeReliableCommands(); extern void CL_FreeServerCommands(void); CL_FreeServerCommands(); memset( &clc, 0, sizeof( clc ) ); cls.state = CA_DISCONNECTED; // allow cheats locally Cvar_Set( "timescale", "1" );//jic we were skipping Cvar_Set( "skippingCinematic", "0" );//jic we were skipping }
void SV_ClearLastLevel(void) { Menu_Reset(); Z_TagFree(TAG_G_ALLOC); Z_TagFree(TAG_UI_ALLOC); G_FreeRoffs(); R_ModelFree(); Music_Free(); Sys_IORequestQueueClear(); AS_FreePartial(); G_ASPreCacheFree(); Ghoul2InfoArray_Free(); G2_FreeRag(); ClearAllNavStructures(); ClearModelsAlreadyDone(); CL_FreeServerCommands(); CL_FreeReliableCommands(); CM_Free(); ShaderEntryPtrs_Clear(); numVehicles = 0; if (svs.clients) { SV_FreeClient( svs.clients ); } }
/* ===================== CL_Disconnect Called when a connection, or cinematic is being terminated. Goes from a connected state to either a menu state or a console state Sends a disconnect message to the server This is also called on Com_Error and Com_Quit, so it shouldn't cause any errors ===================== */ void CL_Disconnect( void ) { if ( !com_cl_running || !com_cl_running->integer ) { return; } #ifdef _XBOX Cvar_Set("r_norefresh", "0"); // Make sure to stop all rumbling! - Prevents bug when quitting game during rumble: extern void IN_KillRumbleScripts( void ); IN_KillRumbleScripts(); #endif if (cls.uiStarted) UI_SetActiveMenu( NULL,NULL ); SCR_StopCinematic (); S_ClearSoundBuffer(); #ifdef _XBOX // extern qboolean RE_RegisterImages_LevelLoadEnd(void); // RE_RegisterImages_LevelLoadEnd(); R_DeleteTextures(); #endif // send a disconnect message to the server // send it a few times in case one is dropped if ( cls.state >= CA_CONNECTED ) { CL_AddReliableCommand( "disconnect" ); CL_WritePacket(); CL_WritePacket(); CL_WritePacket(); } CL_ClearState (); CL_FreeReliableCommands(); extern void CL_FreeServerCommands(void); CL_FreeServerCommands(); memset( &clc, 0, sizeof( clc ) ); cls.state = CA_DISCONNECTED; // allow cheats locally Cvar_Set( "timescale", "1" );//jic we were skipping Cvar_Set( "skippingCinematic", "0" );//jic we were skipping }