From 7ebc0d673ceb9ab2f64583878f664a9a97d0a269 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sat, 8 Apr 2023 16:47:39 +1000 Subject: [PATCH] fix(client): check weapon specialAmmo is a string If I had a nickel for every person that reported a reloading bug due to indexing a number value on line 444, I'd have two nickels; which isn't a lot, but it's weird that it happened twice. --- client.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.lua b/client.lua index 44edf9f72f..374fba06d5 100644 --- a/client.lua +++ b/client.lua @@ -439,7 +439,7 @@ local function useSlot(slot) useItem(data, function(resp) if not resp or resp.name ~= currentWeapon?.ammo then return end - if currentWeapon.metadata.specialAmmo ~= resp.metadata.type then + if currentWeapon.metadata.specialAmmo ~= resp.metadata.type and type(currentWeapon.metadata.specialAmmo) == 'string' then local clipComponentKey = ('%s_CLIP'):format(Items[currentWeapon.name].model:gsub('WEAPON_', 'COMPONENT_')) local specialClip = ('%s_%s'):format(clipComponentKey, (resp.metadata.type or currentWeapon.metadata.specialAmmo):upper())