From: Rui Date: Sat, 5 Nov 2016 02:58:13 +0000 (+0900) Subject: Creative: Fix crash when turning on creative in-game X-Git-Tag: 0.4.15~51 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5868274b002998341b965bb98dd9499d3d6d7b75;p=oweals%2Fminetest_game.git Creative: Fix crash when turning on creative in-game --- 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)