Skip to content

Commit

Permalink
fix variable scope in npc.lua (#4187)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zbizu authored Aug 10, 2022
1 parent 85a184e commit 5a939c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data/npc/lib/npc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ end
function doNpcSellItem(cid, itemid, amount, subType, ignoreCap, inBackpacks, backpack)
local amount = amount or 1
local subType = subType or 0
local item = 0

if ItemType(itemid):isStackable() then
local stuff
if inBackpacks then
stuff = Game.createItem(backpack, 1)
item = stuff:addItem(itemid, math.min(100, amount))
stuff:addItem(itemid, math.min(100, amount))
else
stuff = Game.createItem(itemid, math.min(100, amount))
end
Expand Down

0 comments on commit 5a939c4

Please sign in to comment.