Fix waypoint initialization order

This commit is contained in:
SmallJoker 2021-08-29 07:47:32 +02:00
parent 3fffa41eaf
commit b1c85a2cb8
3 changed files with 5 additions and 6 deletions

@ -24,8 +24,7 @@ minetest.register_on_joinplayer(function(player)
unified_inventory.alternate[player_name] = 1 unified_inventory.alternate[player_name] = 1
unified_inventory.current_item[player_name] = nil unified_inventory.current_item[player_name] = nil
unified_inventory.current_craft_direction[player_name] = "recipe" unified_inventory.current_craft_direction[player_name] = "recipe"
unified_inventory.set_inventory_formspec(player, unified_inventory.set_inventory_formspec(player, unified_inventory.default)
unified_inventory.default)
-- Refill slot -- Refill slot
local refill = minetest.create_detached_inventory(player_name.."refill", { local refill = minetest.create_detached_inventory(player_name.."refill", {

@ -375,6 +375,5 @@ function ui.apply_filter(player, filter, search_dir)
ui.current_index[player_name] = 1 ui.current_index[player_name] = 1
ui.activefilter[player_name] = filter ui.activefilter[player_name] = filter
ui.active_search_direction[player_name] = search_dir ui.active_search_direction[player_name] = search_dir
ui.set_inventory_formspec(player, ui.set_inventory_formspec(player, ui.current_page[player_name])
ui.current_page[player_name])
end end

@ -330,8 +330,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end end
end) end)
-- waypoints_temp must be initialized before the general unified_inventory
minetest.register_on_joinplayer(function(player) -- joinplayer callback is run for updating the inventory
table.insert(minetest.registered_on_joinplayers, 1, function(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
local waypoints = get_waypoint_data(player) local waypoints = get_waypoint_data(player)