PlayerRankings: Add some checks.

This commit is contained in:
zaCade 2019-07-17 13:16:40 +02:00
parent edd8fd85d2
commit ce3804b3d5

View File

@ -391,7 +391,7 @@ public Action UpdateCrowns(Handle timer)
if (g_bEngineCSGO)
return;
if (IsValidEntity(g_iCrownEntity))
if (IsValidEntity(g_iCrownEntity) && IsValidEntity(g_iCrownParent) && IsClientInGame(g_iCrownParent))
{
float fAngles[3];
GetClientAbsAngles(g_iCrownParent, fAngles);
@ -402,7 +402,7 @@ public Action UpdateCrowns(Handle timer)
TeleportEntity(g_iCrownEntity, NULL_VECTOR, fAngles, NULL_VECTOR);
}
if (IsValidEntity(g_iSkullEntity))
if (IsValidEntity(g_iSkullEntity) && IsValidEntity(g_iSkullParent) && IsClientInGame(g_iSkullParent))
{
float fAngles[3];
GetClientAbsAngles(g_iSkullParent, fAngles);