Skip to content

Commit

Permalink
Fix check in charges.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Nov 28, 2023
1 parent 35bebfd commit 5fe37ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data-otservbr-global/npc/jeronimo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ local function creatureSayCallback(npc, creature, type, message)
if inbox and inbox:getEmptySlots() > 0 and player:getFreeCapacity() >= itemT:getCapacity() then
player:updateTournamentCoins(selected.value, "remove")

if selected.charges > 0 then
if selected.charges ~= nil and selected.charges > 0 then
local addedItem = player:addItem(selected.id, selected.count, true)
addedItem:setAttribute("charges", selected.charges)
else
selected.charges = 0
if selected.wrap then
local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1)
if decoKit then
Expand Down

0 comments on commit 5fe37ed

Please sign in to comment.