diff --git a/FixPlayerEquip/scripting/FixPlayerEquip.sp b/FixPlayerEquip/scripting/FixPlayerEquip.sp index 23a99a06..d4cdeb71 100644 --- a/FixPlayerEquip/scripting/FixPlayerEquip.sp +++ b/FixPlayerEquip/scripting/FixPlayerEquip.sp @@ -78,12 +78,11 @@ public Action OnUse(int entity, int client) { if(!bGaveAmmo) { - int iWeapon = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY); - if(iWeapon != -1) + int iWeapon = INVALID_ENT_REFERENCE; + if((iWeapon = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY)) != INVALID_ENT_REFERENCE) StockPlayerAmmo(client, iWeapon); - iWeapon = GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY); - if(iWeapon != -1) + if((iWeapon = GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY)) != INVALID_ENT_REFERENCE) StockPlayerAmmo(client, iWeapon); bGaveAmmo = true;