AmmoManager: Dont bother hooking what we dont have.

This commit is contained in:
zaCade 2018-11-12 19:03:32 +01:00
parent 1ed199e1ea
commit a8c20e5fe2
2 changed files with 7 additions and 4 deletions

View File

@ -108,8 +108,11 @@ public void OnEntityCreated(int entity, const char[] classname)
{
if (strncmp(classname, "weapon_", 7, false) == 0)
{
DHookEntity(g_hGetMaxClip, true, entity);
DHookEntity(g_hGetMaxReserve, true, entity);
if (g_hGetMaxClip != INVALID_HANDLE)
DHookEntity(g_hGetMaxClip, true, entity);
if (g_hGetMaxReserve != INVALID_HANDLE)
DHookEntity(g_hGetMaxReserve, true, entity);
}
}