From 4ca50e846db77c286b370c5b5962f7b673815ecd Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 5 Jul 2021 03:21:04 +0200 Subject: [PATCH] Fix potential issue with progressive mode --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8060036..1b6a8d3 100644 --- a/init.lua +++ b/init.lua @@ -3273,6 +3273,7 @@ if progressive_mode then local player = players[i] local name = player:get_player_name() local data = pdata[name] + if not data then return end local inv_items = get_inv_items(player) local diff = array_diff(inv_items, data.inv_items) @@ -3308,7 +3309,7 @@ if progressive_mode then local name = player:get_player_name() local data = pdata[name] - if data.show_hud ~= nil and singleplayer then + if data and data.show_hud ~= nil and singleplayer then show_hud_success(player, data) end end @@ -3319,6 +3320,7 @@ if progressive_mode then core.register_on_joinplayer(function(player) local name = player:get_player_name() local data = pdata[name] + if not data then return end data.inv_items = data.inv_items or {} data.known_recipes = data.known_recipes or 0