From 200536b41601bf1ceb4bfede3982bbb1ff4c3cc3 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 14 Feb 2022 01:20:30 +0000 Subject: [PATCH] #198 Fix a crash, step 1 --- mods/HELP/doc/doc/init.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/HELP/doc/doc/init.lua b/mods/HELP/doc/doc/init.lua index 304900753..df675bf1d 100644 --- a/mods/HELP/doc/doc/init.lua +++ b/mods/HELP/doc/doc/init.lua @@ -1124,10 +1124,10 @@ minetest.register_chatcommand("helpform", { } ) -minetest.register_on_joinplayer(function(player) - local playername = player:get_player_name() +minetest.register_on_authplayer(function(playername, ip, is_success) + if not is_success then return end local playerdata = doc.data.players[playername] - if playerdata == nil then + if not playerdata then -- Initialize player data doc.data.players[playername] = {} playerdata = doc.data.players[playername] @@ -1171,7 +1171,9 @@ minetest.register_on_joinplayer(function(player) playerdata.stored_data.revealed_count[cid] = rc end end +end +minetest.register_on_joinplayer(function(player) -- Add button for Inventory++ if mod_inventory_plus then inventory_plus.register_button(player, "doc_inventory_plus", S("Help"))