core/PlayerManager.cpp
changeset 1369 bd9ccced1b1a
parent 1363 225fe47043bd
child 1412 a2ca3d22dd71
     1.1 --- a/core/PlayerManager.cpp	Fri Aug 24 23:56:57 2007 +0000
     1.2 +++ b/core/PlayerManager.cpp	Sun Aug 26 17:41:02 2007 +0000
     1.3 @@ -549,6 +549,15 @@
     1.4  
     1.5  void PlayerManager::OnClientCommand(edict_t *pEntity)
     1.6  {
     1.7 +	int client = engine->IndexOfEdict(pEntity);
     1.8 +	cell_t res = Pl_Continue;
     1.9 +
    1.10 +	CPlayer *pPlayer = GetPlayerByIndex(client);
    1.11 +	if (!pPlayer || !pPlayer->IsConnected())
    1.12 +	{
    1.13 +		return;
    1.14 +	}
    1.15 +
    1.16  	/**
    1.17  	 * We cache this because the engine is not re-entrant.
    1.18  	 */
    1.19 @@ -556,9 +565,6 @@
    1.20  	int args = engine->Cmd_Argc() - 1;
    1.21  	strncopy(cmd, engine->Cmd_Argv(0), sizeof(cmd));
    1.22  
    1.23 -	int client = engine->IndexOfEdict(pEntity);
    1.24 -	cell_t res = Pl_Continue;
    1.25 -
    1.26  	bool result = g_ValveMenuStyle.OnClientCommand(client, cmd);
    1.27  	if (result)
    1.28  	{