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) public void OnEntityCreated(int iEntity, const char[] sClassname)
{ {
if (IsValidEntity(iEntity)) if (!IsValidEntity(iEntity) || g_bVoteFinished)
SDKHook(iEntity, SDKHook_SpawnPost, OnEntitySpawned); return;
SDKHook(iEntity, SDKHook_SpawnPost, OnEntitySpawned);
} }
public void OnEntitySpawned(int iEntity) public void OnEntitySpawned(int iEntity)
{ {
if (g_bVoteFinished) if (!IsValidEntity(iEntity) || g_bVoteFinished)
return; return;
char sTargetname[128]; char sTargetname[128];