fix error

This commit is contained in:
Bunny67
2018-07-18 17:52:00 +03:00
parent ad88970195
commit 333f08d479
+4 -1
View File
@@ -32,11 +32,14 @@ local AVD_DECAY_RATE = 0.2
local function IsWearingShield() local function IsWearingShield()
local slotID = GetInventorySlotInfo("SecondaryHandSlot") local slotID = GetInventorySlotInfo("SecondaryHandSlot")
local _, _, itemID = find(GetInventoryItemLink("player", slotID), "(%d+):") local link = GetInventoryItemLink("player", slotID)
if link then
local _, _, itemID = find(link, "(%d+):")
if itemID then if itemID then
return select(9, GetItemInfo(itemID)) return select(9, GetItemInfo(itemID))
end end
end
end end
local function OnEvent(self) local function OnEvent(self)