aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authortjw <tjw@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-03-02 17:32:22 +0000
committertjw <tjw@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-03-02 17:32:22 +0000
commitd13b3695113e9843c50b8c9712dabd9df2a4d442 (patch)
tree3fa9754f512fe88c8c5e8ad114a7aae4baa84430 /code
parent5691dfa32ca097d737193e0b3362ad29bda336c5 (diff)
downloadioquake3-aero-d13b3695113e9843c50b8c9712dabd9df2a4d442.tar.gz
ioquake3-aero-d13b3695113e9843c50b8c9712dabd9df2a4d442.zip
* (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. git-svn-id: svn://svn.icculus.org/quake3/trunk@1048 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/client/cl_cgame.c4
-rw-r--r--code/client/cl_parse.c4
-rw-r--r--code/client/cl_ui.c4
-rw-r--r--code/client/client.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/code/client/cl_cgame.c b/code/client/cl_cgame.c
index e2c682e..d767b8a 100644
--- a/code/client/cl_cgame.c
+++ b/code/client/cl_cgame.c
@@ -746,6 +746,10 @@ void CL_InitCGame( void ) {
// 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;
diff --git a/code/client/cl_parse.c b/code/client/cl_parse.c
index 35b6605..6bac6d0 100644
--- a/code/client/cl_parse.c
+++ b/code/client/cl_parse.c
@@ -325,6 +325,7 @@ void CL_ParseSnapshot( msg_t *msg ) {
//=====================================================================
int cl_connectedToPureServer;
+int cl_connectedToCheatServer;
/*
==================
@@ -355,7 +356,8 @@ void CL_SystemInfoChanged( void ) {
}
s = Info_ValueForKey( systemInfo, "sv_cheats" );
- if ( atoi(s) == 0 ) {
+ cl_connectedToCheatServer = atoi( s );
+ if ( !cl_connectedToCheatServer ) {
Cvar_SetCheatState();
}
diff --git a/code/client/cl_ui.c b/code/client/cl_ui.c
index 45c0c37..9345647 100644
--- a/code/client/cl_ui.c
+++ b/code/client/cl_ui.c
@@ -1171,6 +1171,10 @@ void CL_InitUI( void ) {
// 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 ) {
diff --git a/code/client/client.h b/code/client/client.h
index df6fe6f..c576dca 100644
--- a/code/client/client.h
+++ b/code/client/client.h
@@ -442,6 +442,7 @@ char *Key_KeynumToString (int keynum);
// cl_parse.c
//
extern int cl_connectedToPureServer;
+extern int cl_connectedToCheatServer;
void CL_SystemInfoChanged( void );
void CL_ParseServerMessage( msg_t *msg );