From 19d2fb012968269684633603da1a635bb9528d80 Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sat, 5 Oct 2019 23:55:52 +0100 Subject: spectator noclip --- install.sh | 7 ------- src/game/g_active.c | 7 ++++++- src/game/g_local.h | 2 ++ src/game/g_main.c | 6 +++++- 4 files changed, 13 insertions(+), 9 deletions(-) delete mode 100755 install.sh diff --git a/install.sh b/install.sh deleted file mode 100755 index bec2ab7..0000000 --- a/install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [ -z "$1" ]; then - echo "$0 [instance]" -fi - -cp bld/out/gpp/game.so ~/tmp.so && mv ~/tmp.so ~/over\@$1/slacker/game.so 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 ] ); -- cgit