Make sure hooks are entity hooks before removing.

This commit is contained in:
Drifter 2016-12-09 08:22:09 -05:00
parent fd8866a540
commit d506ce912e

View File

@ -75,7 +75,7 @@ void DHooksEntityListener::OnEntityDestroyed(CBaseEntity *pEntity)
for(int i = g_pHooks.length() -1; i >= 0; i--) for(int i = g_pHooks.length() -1; i >= 0; i--)
{ {
DHooksManager *manager = g_pHooks.at(i); DHooksManager *manager = g_pHooks.at(i);
if(manager->callback->entity == entity) if(manager->callback->hookType == HookType_Entity && manager->callback->entity == entity)
{ {
if(g_pRemoveList.length() == 0) if(g_pRemoveList.length() == 0)
{ {