Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Fix redskull and blackskull droploot #757

Merged
merged 3 commits into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions data/modules/scripts/blessings/blessings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,22 @@ Blessings.DropLoot = function(player, corpse, chance, skulled)
end
if skulled and Blessings.Config.SkulledDeathLoseStoreItem then
local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX)
local inboxsize = inbox:getSize() - 1
for i = 0, inboxsize do
inbox:getItem(i):destroy()
local toBeDeleted = {}
if inbox and inbox:getSize() > 0 then
for i = 0, inbox:getSize() do
local item = inbox:getItem(i)
if item then
toBeDeleted[#toBeDeleted + 1] = item.uid
end
end
if #toBeDeleted > 0 then
for i, v in pairs(toBeDeleted) do
local item = Item(v)
if item then
item:remove()
end
end
end
end
end
end
Expand Down