- Improve game_restart:

* differing screen resolutions and network settings are now honoured when changing fs_game
  * Fix hunk memory leak on game_restart
  * Move cls.state and cls.servername to clc so connection state is fully preserved over game_restart
  * Revert back to previous fs_game after disconnecting from a server that triggered a game_restart
  * Fix error dialog popping up after every game_restart if an error happened previously (reported by Ensiform)
- Fixed that not all commands added by CL_Init() would be removed by CL_Shutdown()
This commit is contained in:
Thilo Schulz 2011-06-21 11:18:35 +00:00
parent adc143e050
commit dee3724a13
17 changed files with 354 additions and 191 deletions

View file

@ -743,7 +743,7 @@ void CL_InitCGame( void ) {
if ( !cgvm ) {
Com_Error( ERR_DROP, "VM_Create on cgame failed" );
}
cls.state = CA_LOADING;
clc.state = CA_LOADING;
// init for this gamestate
// use the lastExecutedServerCommand instead of the serverCommandSequence
@ -756,7 +756,7 @@ void CL_InitCGame( void ) {
// we will send a usercmd this frame, which
// will cause the server to send us the first snapshot
cls.state = CA_PRIMED;
clc.state = CA_PRIMED;
t2 = Sys_Milliseconds();
@ -894,7 +894,7 @@ void CL_FirstSnapshot( void ) {
if ( cl.snap.snapFlags & SNAPFLAG_NOT_ACTIVE ) {
return;
}
cls.state = CA_ACTIVE;
clc.state = CA_ACTIVE;
// set the timedelta so we are exactly on this first frame
cl.serverTimeDelta = cl.snap.serverTime - cls.realtime;
@ -965,8 +965,8 @@ CL_SetCGameTime
*/
void CL_SetCGameTime( void ) {
// getting a valid frame message ends the connection process
if ( cls.state != CA_ACTIVE ) {
if ( cls.state != CA_PRIMED ) {
if ( clc.state != CA_ACTIVE ) {
if ( clc.state != CA_PRIMED ) {
return;
}
if ( clc.demoplaying ) {
@ -982,7 +982,7 @@ void CL_SetCGameTime( void ) {
cl.newSnapshots = qfalse;
CL_FirstSnapshot();
}
if ( cls.state != CA_ACTIVE ) {
if ( clc.state != CA_ACTIVE ) {
return;
}
}
@ -1095,7 +1095,7 @@ void CL_SetCGameTime( void ) {
// feed another messag, which should change
// the contents of cl.snap
CL_ReadDemoMessage();
if ( cls.state != CA_ACTIVE ) {
if ( clc.state != CA_ACTIVE ) {
return; // end of demo
}
}