From 8bc5b6fdd9424823a0c46b961f4a4d12b2a8692c Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 9 Jul 2017 07:38:35 +0200 Subject: 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 --- src/game/g_admin.c | 4 ++-- 1 file 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 ) ); -- cgit