Closed redblade7 closed 3 years ago
Does this fix your issue?
diff --git a/callbacks.lua b/callbacks.lua
index 1f43e39..317c3c8 100644
--- a/callbacks.lua
+++ b/callbacks.lua
@@ -24,8 +24,7 @@ minetest.register_on_joinplayer(function(player)
unified_inventory.alternate[player_name] = 1
unified_inventory.current_item[player_name] = nil
unified_inventory.current_craft_direction[player_name] = "recipe"
- unified_inventory.set_inventory_formspec(player,
- unified_inventory.default)
+ unified_inventory.set_inventory_formspec(player, unified_inventory.default)
-- Refill slot
local refill = minetest.create_detached_inventory(player_name.."refill", {
diff --git a/internal.lua b/internal.lua
index f83f96b..76a277d 100644
--- a/internal.lua
+++ b/internal.lua
@@ -375,6 +375,5 @@ function ui.apply_filter(player, filter, search_dir)
ui.current_index[player_name] = 1
ui.activefilter[player_name] = filter
ui.active_search_direction[player_name] = search_dir
- ui.set_inventory_formspec(player,
- ui.current_page[player_name])
+ ui.set_inventory_formspec(player, ui.current_page[player_name])
end
diff --git a/waypoints.lua b/waypoints.lua
index 08fce38..1496cdd 100644
--- a/waypoints.lua
+++ b/waypoints.lua
@@ -330,8 +330,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end)
-
-minetest.register_on_joinplayer(function(player)
+-- waypoints_temp must be initialized before the general unified_inventory
+-- 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 waypoints = get_waypoint_data(player)
Can you please attach this as a normal patch file?
This is a diff, not a patch. Here's the patch (after commit), renamed to .pdf
because GitHub does not allow .patch
files.
0001-Fix-waypoint-initialization-order.pdf
EDIT: After all, those changes would be pretty simple to perform in an ssh session (only the changes in waypoints.lua
) are relevant.
Thank you! I've applied the patch to my servers and will let you know if I get any more crashes.
I haven't had any crashes since installing the patch.
b1c85a2
On 7/29/2021, I updated all the mods on my three Minetest servers, including unified_inventory. Since then I have been having bizarre occasional server crashes related to unified_inventory and waypoints when certain players join, usually the same players.
The mods had been last updated on 4/11/2021, so this bug has been introduced sometime after then.
Here is the debug.txt output of an example crash: