summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-04-13 11:30:00 +0000
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:24:18 +0200
commitbfb616d6541e4e0333b7d1ed53b945d16d18fad9 (patch)
tree517f8359df41297daa30a3a0ac716f0d5ab6f4c7 /src/game/g_cmds.c
parentf38f646bfc1b9b3904359b92cbd16377cd618308 (diff)
fix noclipping players affecting other players
notably, other players were able to stand on the "center" of a noclipped player set no r.contents flags for noclipping clients, keeping the saved r.contents value in the new ent->client->pers.cliprcontents field
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index ec2b7db..9ebb659 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -527,9 +527,16 @@ void Cmd_Noclip_f( gentity_t *ent )
if( !g_devmapNoGod.integer )
{
if( ent->client->noclip )
+ {
msg = "noclip OFF\n";
+ ent->r.contents = ent->client->pers.cliprcontents;
+ }
else
+ {
msg = "noclip ON\n";
+ ent->client->pers.cliprcontents = ent->r.contents;
+ ent->r.contents = 0;
+ }
ent->client->noclip = !ent->client->noclip;
}