2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-04 17:42:22 +01:00

engine: fix client can use kill command while not connected (#492)

This commit is contained in:
Barış 2021-06-12 18:19:23 +03:00 committed by GitHub
parent 9b1fccd1fa
commit 18d8ef287d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1894,6 +1894,12 @@ static qboolean SV_Kill_f( sv_client_t *cl )
if( !SV_IsValidEdict( cl->edict )) if( !SV_IsValidEdict( cl->edict ))
return true; 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 ) if( cl->edict->v.health <= 0.0f )
{ {
SV_ClientPrintf( cl, "Can't suicide - already dead!\n"); SV_ClientPrintf( cl, "Can't suicide - already dead!\n");