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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local items = GameGetAllInventoryItems(player) or {}
|
local children = EntityGetAllChildren(player)
|
||||||
for _, item_id in ipairs(items) do
|
for _, child in pairs(children) do
|
||||||
GameKillInventoryItem(player, item_id)
|
if EntityGetName(child) == "inventory_quick" then
|
||||||
EntityKill(item_id)
|
local inv = EntityGetAllChildren(child)
|
||||||
|
if inv ~= nil then
|
||||||
|
for _, item in pairs(inv) do
|
||||||
|
EntityKill(item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,16 @@ local function remove_inventory_tags()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function remove_inventory()
|
local function remove_inventory()
|
||||||
local items = GameGetAllInventoryItems(ctx.my_player.entity)
|
local children = EntityGetAllChildren(ctx.my_player.entity)
|
||||||
for _, item in ipairs(items) do
|
for _, child in pairs(children) do
|
||||||
EntityKill(item)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue