Only AddFrameAction once.

This commit is contained in:
Dr!fter 2016-08-26 21:01:59 -04:00
parent c95724a9ac
commit 98fcde86c1

View File

@ -75,13 +75,19 @@ void DHooksEntityListener::OnEntityDestroyed(CBaseEntity *pEntity)
}
}
bool bDeleting = false;
for(int i = g_pHooks.size() -1; i >= 0; i--)
{
DHooksManager *manager = g_pHooks.at(i);
if(manager->callback->entity == entity)
{
manager->bDelete = true;
smutils->AddFrameAction(&FrameCleanupHooks, NULL);
if (!bDeleting)
{
smutils->AddFrameAction(&FrameCleanupHooks, NULL);
bDeleting = true;
}
}
}
}