Skip to content

Commit

Permalink
fix(client): check weapon specialAmmo is a string
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thelindat committed Apr 8, 2023
1 parent da67cbc commit 7ebc0d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 7ebc0d6

Please sign in to comment.