mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
dont remove spell inventory when revived
This commit is contained in:
parent
1be2aa6992
commit
21ad8e8a63
2 changed files with 20 additions and 7 deletions
|
@ -281,10 +281,16 @@ function inventory_helper.set_item_data(item_data, player_data)
|
|||
return
|
||||
end
|
||||
|
||||
local items = GameGetAllInventoryItems(player) or {}
|
||||
for _, item_id in ipairs(items) do
|
||||
GameKillInventoryItem(player, item_id)
|
||||
EntityKill(item_id)
|
||||
local children = EntityGetAllChildren(player)
|
||||
for _, child in pairs(children) do
|
||||
if EntityGetName(child) == "inventory_quick" then
|
||||
local inv = EntityGetAllChildren(child)
|
||||
if inv ~= nil then
|
||||
for _, item in pairs(inv) do
|
||||
EntityKill(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -33,10 +33,17 @@ local function remove_inventory_tags()
|
|||
end
|
||||
|
||||
local function remove_inventory()
|
||||
local items = GameGetAllInventoryItems(ctx.my_player.entity)
|
||||
for _, item in ipairs(items) do
|
||||
local children = EntityGetAllChildren(ctx.my_player.entity)
|
||||
for _, child in pairs(children) do
|
||||
if EntityGetName(child) == "inventory_quick" then
|
||||
local inv = EntityGetAllChildren(child)
|
||||
if inv ~= nil then
|
||||
for _, item in pairs(inv) do
|
||||
EntityKill(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function allow_notplayer_perk(perk_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue