summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_active.c7
-rw-r--r--src/game/g_local.h2
-rw-r--r--src/game/g_main.c6
3 files changed, 13 insertions, 2 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 63af175..4cf6367 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -407,7 +407,12 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd )
if( client->sess.spectatorState == SPECTATOR_LOCKED || client->sess.spectatorState == SPECTATOR_FOLLOW )
client->ps.pm_type = PM_FREEZE;
else
- client->ps.pm_type = PM_SPECTATOR;
+ {
+ if( g_specNoclip.integer )
+ client->ps.pm_type = PM_NOCLIP;
+ else
+ client->ps.pm_type = PM_SPECTATOR;
+ }
if ( client->sess.spectatorState == SPECTATOR_FOLLOW )
{
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 82ad397..57bb59b 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -1576,6 +1576,8 @@ extern vmCvar_t g_scrimMode;
extern vmCvar_t g_revertCooldownTime;
+extern vmCvar_t g_specNoclip;
+
void trap_Printf( const char *fmt );
void trap_Error( const char *fmt );
int trap_Milliseconds( void );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index b2e329a..c6744e3 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -284,6 +284,8 @@ vmCvar_t g_scrimMode;
vmCvar_t g_revertCooldownTime;
+vmCvar_t g_specNoclip;
+
static cvarTable_t gameCvarTable[ ] =
{
// don't override the cheat state set by the system
@@ -555,7 +557,9 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_schachtmeisterAutobahnThreshold, "g_schachtmeisterAutobahnThreshold", "-30", CVAR_ARCHIVE, 0, qfalse },
{ &g_schachtmeisterAutobahnMessage, "g_schachtmeisterAutobahnMessage", "Your host is blacklisted.", CVAR_ARCHIVE, 0, qfalse },
- { &g_revertCooldownTime, "g_revertCooldownTime", "30", CVAR_ARCHIVE, 0, qfalse }
+ { &g_revertCooldownTime, "g_revertCooldownTime", "30", CVAR_ARCHIVE, 0, qfalse },
+
+ { &g_specNoclip, "g_specNoclip", "0", CVAR_ARCHIVE, 0, qtrue }
};
static int gameCvarTableSize = sizeof( gameCvarTable ) / sizeof( gameCvarTable[ 0 ] );