summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-13 17:14:58 +0200
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:11 +0100
commit7224c7bf34cf7548f86a3af2247240705c0f4b4b (patch)
tree490bc2ad2d623735ecb05b7d6869aa3895027262 /src/game/g_active.c
parent36920a29e0ef0d7d9d94597b3ca77abf572994dd (diff)
improve the usability of noclip, notarget, give and godmode:
- godmode protects against everything (except suicides via the kill command) - godmode can also be toggled when dead or spectating - noclip, notarget, and godmode retain their status until explicitly toggled (except when outside of devmode, or when reconnecting), notably, they are not turned off when switching teams or suiciding - funds can be given also when dead - noclipping players do not activate any triggers - map geometry does not interfere with noclipping players when it comes to changing classes
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index d2abf65d..f99e7661 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -324,6 +324,10 @@ void G_TouchTriggers( gentity_t *ent )
if( !ent->client )
return;
+ // noclipping clients don't activate triggers!
+ if( ent->client->noclip )
+ return;
+
// dead clients don't activate triggers!
if( ent->client->ps.stats[ STAT_HEALTH ] <= 0 )
return;
@@ -1550,8 +1554,7 @@ void ClientThink_real( gentity_t *ent )
// moved from after Pmove -- potentially the cause of
// future triggering bugs
- if( !ent->client->noclip )
- G_TouchTriggers( ent );
+ G_TouchTriggers( ent );
Pmove( &pm );
@@ -1730,7 +1733,6 @@ void ClientThink_real( gentity_t *ent )
if( ent->suicideTime > 0 && ent->suicideTime < level.time )
{
- ent->flags &= ~FL_GODMODE;
ent->client->ps.stats[ STAT_HEALTH ] = ent->health = 0;
player_die( ent, ent, ent, 100000, MOD_SUICIDE );