From 18d8ef287dfc8bee633aa0a1bace92684b2b6378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F?= <85716242+bariscodefxy@users.noreply.github.com> Date: Sat, 12 Jun 2021 18:19:23 +0300 Subject: [PATCH] engine: fix client can use kill command while not connected (#492) --- engine/server/sv_client.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/server/sv_client.c b/engine/server/sv_client.c index 8262ae0f..a7bb9d35 100644 --- a/engine/server/sv_client.c +++ b/engine/server/sv_client.c @@ -1893,6 +1893,12 @@ static qboolean SV_Kill_f( sv_client_t *cl ) { if( !SV_IsValidEdict( cl->edict )) return true; + + if( cl->state != cs_spawned ) + { + SV_ClientPrintf( cl, "Can't suicide - not connected!\n" ); + return true; + } if( cl->edict->v.health <= 0.0f ) {