Skip to content

Commit

Permalink
fix: drop item with charges from monsters (#1858)
Browse files Browse the repository at this point in the history
Resolves #1843
  • Loading branch information
dudantas authored Nov 21, 2023
1 parent 7554fc6 commit 232baa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion data/libs/functions/monstertype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ function MonsterType:generateLootRoll(config, resultTable)
end

local count = 0
if iType:isStackable() then
local charges = iType:getCharges()
if charges > 0 then
count = charges
elseif iType:isStackable() then
local maxc, minc = item.maxCount or 1, item.minCount or 1
count = math.max(0, randValue % (maxc - minc + 1)) + minc
else
Expand Down

0 comments on commit 232baa8

Please sign in to comment.