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

@ -70,12 +70,12 @@
"primary clip" "100"
"primary reserve" "200"
}
"weapon_m4a1"
"weapon_m4a1"
{
"primary clip" "30"
"primary reserve" "90"
}
"weapon_m4a1_silencer"
"weapon_m4a1_silencer"
{
"primary clip" "20"
"primary reserve" "60"

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);
}
}