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

Commit

Permalink
remove armors drop, replaced by bones mod soon
Browse files Browse the repository at this point in the history
fix crash in unified_inventory, on join if died, detached inventory is nil
  • Loading branch information
Crabman77 committed Jan 24, 2017
1 parent 06a1153 commit 2cb3a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mods/3d_armor/3d_armor/armor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ minetest.register_on_joinplayer(function(player)
end, player)
end
end)

--[[
if ARMOR_DROP == true or ARMOR_DESTROY == true then
armor.drop_armor = function(pos, stack)
local obj = minetest.add_item(pos, stack)
Expand Down Expand Up @@ -602,6 +602,7 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
end
end)
end
--]]

minetest.register_on_player_hpchange(function(player, hp_change)
local name, player_inv, armor_inv = armor:get_valid_player(player, "[on_hpchange]")
Expand Down
6 changes: 5 additions & 1 deletion mods/unified_inventory/bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,11 @@ function unified_inventory.extract_bag(player, id)
end

pinv:remove_item("bag" .. id, stack)
minetest.get_inventory({type = "detached", name = minetest.formspec_escape(player:get_player_name()) .. "_bags"}):set_stack("bag" .. id, 1, nil)
local dinv = minetest.get_inventory({type = "detached", name = minetest.formspec_escape(player:get_player_name()) .. "_bags"})
if dinv then
dinv:set_stack("bag" .. id, 1, nil)
end

pinv:set_list("bag" .. id .. "contents", {})

stack:set_metadata(minetest.serialize(list))
Expand Down

0 comments on commit 2cb3a70

Please sign in to comment.