Fix creative inv. jump to search on armor change

This commit is contained in:
Wuzzy 2017-03-09 18:58:35 +01:00
parent 9f01a4993b
commit 10db71320e

View file

@ -35,9 +35,14 @@ local function update_armor(player)
return return
end end
local function set_inventory(player) local function set_inventory(player, armor_change_only)
if minetest.setting_getbool("creative_mode") then if minetest.setting_getbool("creative_mode") then
if armor_change_only then
-- Stay on survival inventory plage if only the armor has been changed
mcl_inventory.set_creative_formspec(player, 0, 0, nil, "inv")
else
mcl_inventory.set_creative_formspec(player, 0, 1) mcl_inventory.set_creative_formspec(player, 0, 1)
end
return return
end end
local inv = player:get_inventory() local inv = player:get_inventory()
@ -158,7 +163,7 @@ minetest.register_on_joinplayer(function(player)
armor.set_player_armor = function(self, player) armor.set_player_armor = function(self, player)
armor_orginal(self, player) armor_orginal(self, player)
update_armor(player) update_armor(player)
set_inventory(player) set_inventory(player, true)
end end
end end