Skip to content

Commit

Permalink
Fix sfinv page not updating on award unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Sep 13, 2018
1 parent 29a1b97 commit 805720b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,22 @@ if minetest.get_modpath("sfinv") then
end
end
})

local function check_and_reshow(name)
local player = minetest.get_player_by_name(name)
if not player then
return
end

local context = sfinv.get_or_create_context(player)
if context.page ~= "awards:awards" then
return
end

sfinv.set_player_inventory_formspec(player, context)
end

awards.register_on_unlock(check_and_reshow)
end

if minetest.get_modpath("unified_inventory") ~= nil then
Expand Down

0 comments on commit 805720b

Please sign in to comment.