summaryrefslogtreecommitdiff
path: root/src/game/g_client.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_client.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_client.c')
-rw-r--r--src/game/g_client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 01986061..76078040 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1199,6 +1199,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
int i;
clientPersistant_t saved;
clientSession_t savedSess;
+ qboolean savedNoclip;
int persistant[ MAX_PERSISTANT ];
gentity_t *spawnPoint = NULL;
int flags;
@@ -1281,6 +1282,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
saved = client->pers;
savedSess = client->sess;
savedPing = client->ps.ping;
+ savedNoclip = client->noclip;
for( i = 0; i < MAX_PERSISTANT; i++ )
persistant[ i ] = client->ps.persistant[ i ];
@@ -1291,6 +1293,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
client->pers = saved;
client->sess = savedSess;
client->ps.ping = savedPing;
+ client->noclip = savedNoclip;
client->lastkilled_client = -1;
for( i = 0; i < MAX_PERSISTANT; i++ )
@@ -1318,7 +1321,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
ent->die = player_die;
ent->waterlevel = 0;
ent->watertype = 0;
- ent->flags = 0;
+ ent->flags &= FL_GODMODE | FL_NOTARGET;
// calculate each client's acceleration
ent->evaluateAcceleration = qtrue;