Progressive mode: Fix crash on player leaving

This commit is contained in:
Jean-Patrick Guerrero 2019-03-14 14:11:44 +01:00
parent b6181ebd7a
commit 4c0371c5cc

@ -898,11 +898,6 @@ M.register_on_joinplayer(function(player)
init_data(name) init_data(name)
end) end)
M.register_on_leaveplayer(function(player)
local name = player:get_player_name()
player_data[name] = nil
end)
if sfinv_only then if sfinv_only then
sfinv.register_page("craftguide:craftguide", { sfinv.register_page("craftguide:craftguide", {
title = S("Craft Guide"), title = S("Craft Guide"),
@ -1152,6 +1147,11 @@ if progressive_mode then
end) end)
end end
M.register_on_leaveplayer(function(player)
local name = player:get_player_name()
player_data[name] = nil
end)
M.register_chatcommand("craft", { M.register_chatcommand("craft", {
description = S("Show recipe(s) of the pointed node"), description = S("Show recipe(s) of the pointed node"),
func = function(name) func = function(name)