PlayerRankings: Fix error spam galore.

Seems IsValidEntity doesnt work on non CBaseEntity?? Usefull stuff here.
This commit is contained in:
zaCade 2019-07-18 18:12:26 +02:00
parent 978467f3c8
commit ea911ac720

View File

@ -665,6 +665,9 @@ void SpawnCrown(int client)
SetVariantString("!activator");
AcceptEntityInput(entity, "SetParent", client);
if (g_bEngineCSGO)
return;
DataPack data = new DataPack();
data.WriteCell(EntIndexToEntRef(entity));
data.WriteCell(EntIndexToEntRef(client));
@ -712,6 +715,9 @@ void SpawnSkull(int client)
SetVariantString("!activator");
AcceptEntityInput(entity, "SetParent", client);
if (g_bEngineCSGO)
return;
DataPack data = new DataPack();
data.WriteCell(EntIndexToEntRef(entity));
data.WriteCell(EntIndexToEntRef(client));
@ -725,10 +731,16 @@ void SpawnSkull(int client)
//----------------------------------------------------------------------------------------------------
public Action OnCrownUpdate(Handle timer, DataPack data)
{
int entity = EntRefToEntIndex(data.ReadCell());
int client = EntRefToEntIndex(data.ReadCell());
data.Reset();
int entity = INVALID_ENT_REFERENCE;
if ((entity = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
return Plugin_Stop;
int client = INVALID_ENT_REFERENCE;
if ((client = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
return Plugin_Stop;
if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))
{
AcceptEntityInput(entity, "Kill");
@ -752,10 +764,16 @@ public Action OnCrownUpdate(Handle timer, DataPack data)
//----------------------------------------------------------------------------------------------------
public Action OnSkullUpdate(Handle timer, DataPack data)
{
int entity = EntRefToEntIndex(data.ReadCell());
int client = EntRefToEntIndex(data.ReadCell());
data.Reset();
int entity = INVALID_ENT_REFERENCE;
if ((entity = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
return Plugin_Stop;
int client = INVALID_ENT_REFERENCE;
if ((client = EntRefToEntIndex(data.ReadCell())) == INVALID_ENT_REFERENCE)
return Plugin_Stop;
if (!IsValidEntity(entity) || !IsClientInGame(client) || !IsPlayerAlive(client))
{
AcceptEntityInput(entity, "Kill");