From 5868274b002998341b965bb98dd9499d3d6d7b75 Mon Sep 17 00:00:00 2001 From: Rui Date: Sat, 5 Nov 2016 11:58:13 +0900 Subject: [PATCH] Creative: Fix crash when turning on creative in-game --- mods/creative/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 24cd673b..d90426da 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -173,6 +173,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local player_name = player:get_player_name() local inv = player_inventory[player_name] + -- If creative is turned on mid game + if not inv then + creative.init_creative_inventory(player) + creative.set_creative_formspec(player, 0) + return + end + if fields.quit then if inv.tab_id == 1 then creative.set_crafting_formspec(player) -- 2.25.1