From 7224c7bf34cf7548f86a3af2247240705c0f4b4b Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 13 Jul 2014 17:14:58 +0200 Subject: 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 --- src/game/g_active.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game/g_active.c') 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 ); -- cgit