r1048 - trunk/code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Mar 2 12:32:22 EST 2007


Author: tjw
Date: 2007-03-02 12:32:22 -0500 (Fri, 02 Mar 2007)
New Revision: 1048

Modified:
   trunk/code/client/cl_cgame.c
   trunk/code/client/cl_parse.c
   trunk/code/client/cl_ui.c
   trunk/code/client/client.h
Log:
* (bug 3018) need to call Cvar_SetCheatState() after CG_INIT and UI_INIT to
             override user-defined cvar values for CVAR_CHEAT cvars that
             could be registered in cgame and ui.


Modified: trunk/code/client/cl_cgame.c
===================================================================
--- trunk/code/client/cl_cgame.c	2007-03-01 22:02:25 UTC (rev 1047)
+++ trunk/code/client/cl_cgame.c	2007-03-02 17:32:22 UTC (rev 1048)
@@ -746,6 +746,10 @@
 	// otherwise server commands sent just before a gamestate are dropped
 	VM_Call( cgvm, CG_INIT, clc.serverMessageSequence, clc.lastExecutedServerCommand, clc.clientNum );
 
+	// reset any CVAR_CHEAT cvars registered by cgame
+	if ( !cl_connectedToCheatServer )
+		Cvar_SetCheatState();
+
 	// we will send a usercmd this frame, which
 	// will cause the server to send us the first snapshot
 	cls.state = CA_PRIMED;

Modified: trunk/code/client/cl_parse.c
===================================================================
--- trunk/code/client/cl_parse.c	2007-03-01 22:02:25 UTC (rev 1047)
+++ trunk/code/client/cl_parse.c	2007-03-02 17:32:22 UTC (rev 1048)
@@ -325,6 +325,7 @@
 //=====================================================================
 
 int cl_connectedToPureServer;
+int cl_connectedToCheatServer;
 
 /*
 ==================
@@ -355,7 +356,8 @@
 	}
 
 	s = Info_ValueForKey( systemInfo, "sv_cheats" );
-	if ( atoi(s) == 0 ) {
+	cl_connectedToCheatServer = atoi( s );
+	if ( !cl_connectedToCheatServer ) {
 		Cvar_SetCheatState();
 	}
 

Modified: trunk/code/client/cl_ui.c
===================================================================
--- trunk/code/client/cl_ui.c	2007-03-01 22:02:25 UTC (rev 1047)
+++ trunk/code/client/cl_ui.c	2007-03-02 17:32:22 UTC (rev 1048)
@@ -1171,6 +1171,10 @@
 		// init for this gamestate
 		VM_Call( uivm, UI_INIT, (cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE) );
 	}
+
+	// reset any CVAR_CHEAT cvars registered by ui
+	if ( !cl_connectedToCheatServer ) 
+		Cvar_SetCheatState();
 }
 
 qboolean UI_usesUniqueCDKey( void ) {

Modified: trunk/code/client/client.h
===================================================================
--- trunk/code/client/client.h	2007-03-01 22:02:25 UTC (rev 1047)
+++ trunk/code/client/client.h	2007-03-02 17:32:22 UTC (rev 1048)
@@ -442,6 +442,7 @@
 // cl_parse.c
 //
 extern int cl_connectedToPureServer;
+extern int cl_connectedToCheatServer;
 
 void CL_SystemInfoChanged( void );
 void CL_ParseServerMessage( msg_t *msg );




More information about the quake3-commits mailing list