===================== CL_MapLoading A local server is starting to load a map, so update the screen to let the user know about it, then dump all client memory on the hunk from cgame, ui, and renderer ===================== */
| 172 | ===================== |
| 173 | */ |
| 174 | void CL_MapLoading( void ) { |
| 175 | if ( !com_cl_running->integer ) { |
| 176 | return; |
| 177 | } |
| 178 | |
| 179 | Con_Close(); |
| 180 | Key_SetCatcher( 0 ); |
| 181 | |
| 182 | // if we are already connected to the local host, stay connected |
| 183 | if ( cls.state >= CA_CONNECTED && !Q_stricmp( cls.servername, "localhost" ) ) { |
| 184 | cls.state = CA_CONNECTED; // so the connect screen is drawn |
| 185 | memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) ); |
| 186 | // memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) ); |
| 187 | memset( &cl.gameState, 0, sizeof( cl.gameState ) ); |
| 188 | clc.lastPacketSentTime = -9999; |
| 189 | SCR_UpdateScreen(); |
| 190 | } else { |
| 191 | // clear nextmap so the cinematic shutdown doesn't execute it |
| 192 | Cvar_Set( "nextmap", "" ); |
| 193 | CL_Disconnect(); |
| 194 | Q_strncpyz( cls.servername, "localhost", sizeof(cls.servername) ); |
| 195 | cls.state = CA_CHALLENGING; // so the connect screen is drawn |
| 196 | Key_SetCatcher( 0 ); |
| 197 | SCR_UpdateScreen(); |
| 198 | clc.connectTime = -RETRANSMIT_TIMEOUT; |
| 199 | NET_StringToAdr( cls.servername, &clc.serverAddress); |
| 200 | // we don't need a challenge on the localhost |
| 201 | |
| 202 | CL_CheckForResend(); |
| 203 | } |
| 204 | |
| 205 | CL_FlushMemory(); |
| 206 | } |
| 207 | |
| 208 | /* |
| 209 | ===================== |
no test coverage detected