forked from mtcontrib/3d_armor
Fix inventory paging bugs caused by previous commit
This commit is contained in:
parent
3843578a33
commit
f91af02c45
@ -76,7 +76,10 @@ if minetest.get_modpath("inventory_plus") then
|
|||||||
armor:register_on_update(function(player)
|
armor:register_on_update(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local formspec = armor:get_armor_formspec(name, true)
|
local formspec = armor:get_armor_formspec(name, true)
|
||||||
|
local page = player:get_inventory_formspec()
|
||||||
|
if page:find("detached:"..name.."_armor") then
|
||||||
inventory_plus.set_inventory_formspec(player, formspec)
|
inventory_plus.set_inventory_formspec(player, formspec)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
if minetest.get_modpath("crafting") then
|
if minetest.get_modpath("crafting") then
|
||||||
inventory_plus.get_formspec = function(player, page)
|
inventory_plus.get_formspec = function(player, page)
|
||||||
@ -132,14 +135,7 @@ elseif minetest.get_modpath("sfinv") then
|
|||||||
armor.inv_mod = "sfinv"
|
armor.inv_mod = "sfinv"
|
||||||
armor.formspec = armor_formpage
|
armor.formspec = armor_formpage
|
||||||
armor:register_on_update(function(player)
|
armor:register_on_update(function(player)
|
||||||
if sfinv.set_page then
|
sfinv.set_player_inventory_formspec(player)
|
||||||
sfinv.set_page(player, "3d_armor:armor")
|
|
||||||
else
|
|
||||||
-- Backwards compat
|
|
||||||
sfinv.set_player_inventory_formspec(player, {
|
|
||||||
page = "3d_armor:armor"
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
sfinv.register_page("3d_armor:armor", {
|
sfinv.register_page("3d_armor:armor", {
|
||||||
title = "Armor",
|
title = "Armor",
|
||||||
|
Loading…
Reference in New Issue
Block a user