From 31534e260f430a7972170a201d3190c349f8ab20 Mon Sep 17 00:00:00 2001 From: Csoki Date: Mon, 30 Jan 2023 22:14:39 +0100 Subject: [PATCH] fix(client/player/main.lua): WeaponList validation --- client/player/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/player/main.lua b/client/player/main.lua index b9bce70..c2d22a0 100644 --- a/client/player/main.lua +++ b/client/player/main.lua @@ -47,7 +47,7 @@ function HUD:SlowThick() if not Config.Disable.Weapon then self.Data.Weapon.Active, self.Data.Weapon.CurrentWeapon = GetCurrentPedWeapon(PlayerPedId(), false) if self.Data.Weapon.CurrentWeapon == 0 then self.Data.Weapon.Active = false end - if self.Data.Weapon.Active then + if self.Data.Weapon.Active and WeaponList[self.Data.Weapon.CurrentWeapon] then self.Data.Weapon.MaxAmmo = (GetAmmoInPedWeapon(PlayerPedId(), self.Data.Weapon.CurrentWeapon)-ammoInClip) self.Data.Weapon.Name = WeaponList[self.Data.Weapon.CurrentWeapon].label and WeaponList[self.Data.Weapon.CurrentWeapon].label or false self.Data.Weapon.isWeaponMelee = not WeaponList[self.Data.Weapon.CurrentWeapon].ammo