MakoVote: Check if entity still valid PostSpawn.

Error spam galore, finally decided to fix it.
This commit is contained in:
zaCade 2019-02-16 14:15:21 +01:00
parent ce6d2a1d0b
commit cead438b21

View File

@ -65,13 +65,15 @@ public Action VerifyMap()
public void OnEntityCreated(int iEntity, const char[] sClassname)
{
if (IsValidEntity(iEntity))
SDKHook(iEntity, SDKHook_SpawnPost, OnEntitySpawned);
if (!IsValidEntity(iEntity) || g_bVoteFinished)
return;
SDKHook(iEntity, SDKHook_SpawnPost, OnEntitySpawned);
}
public void OnEntitySpawned(int iEntity)
{
if (g_bVoteFinished)
if (!IsValidEntity(iEntity) || g_bVoteFinished)
return;
char sTargetname[128];