summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-07-09 07:38:35 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-07-09 14:50:33 +0200
commit8bc5b6fdd9424823a0c46b961f4a4d12b2a8692c (patch)
tree6f94236008695ea2b1e74275c3e39bc557e6f12f /src/game
parent357ec9764e523ddf2084a9f014922a3d10e22a25 (diff)
fix a crash when !invisible is used
clientPersistent_t::connection can be NULL (and is prolongedly so after a map restart, because the PTRC functionality is broken) no idea why the code was referring to something in a clientRecord_t, it's probably just by stupidity
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_admin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 70a069d..d10c718 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -8928,7 +8928,7 @@ qboolean G_admin_invisible( gentity_t *ent, int skiparg )
// Make the player invisible
G_ChangeTeam( ent, PTE_NONE );
ent->client->sess.invisible = qtrue;
- ClientUserinfoChanged( ent->client->pers.connection->clientNum, qfalse );
+ ClientUserinfoChanged( ent-g_entities, qfalse );
G_admin_namelog_update( ent->client, qtrue );
trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " disconnected\n\"", ent->client->pers.netname ) );
}
@@ -8936,7 +8936,7 @@ qboolean G_admin_invisible( gentity_t *ent, int skiparg )
{
// Make the player visible
ent->client->sess.invisible = qfalse;
- ClientUserinfoChanged( ent->client->pers.connection->clientNum, qfalse );
+ ClientUserinfoChanged( ent-g_entities, qfalse );
G_admin_namelog_update( ent->client, qfalse );
trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " connected\n\"", ent->client->pers.netname ) );
trap_SendServerCommand( -1, va( "print \"%s" S_COLOR_WHITE " entered the game\n\"", ent->client->pers.netname ) );