MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CL_MapLoading

Function CL_MapLoading

code/client/cl_main.cpp:174–206  ·  view source on GitHub ↗

===================== 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 ===================== */

Source from the content-addressed store, hash-verified

172=====================
173*/
174void 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=====================

Callers 1

SV_SpawnServerFunction · 0.50

Calls 10

Q_stricmpFunction · 0.85
Q_strncpyzFunction · 0.85
Con_CloseFunction · 0.70
Key_SetCatcherFunction · 0.70
SCR_UpdateScreenFunction · 0.70
CL_DisconnectFunction · 0.70
CL_CheckForResendFunction · 0.70
CL_FlushMemoryFunction · 0.70
Cvar_SetFunction · 0.50
NET_StringToAdrFunction · 0.50

Tested by

no test coverage detected