Skip to content

Commit

Permalink
Creative: Fix crash when turning on creative in-game
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui authored and paramat committed Nov 7, 2016
1 parent c824d69 commit 5868274
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mods/creative/init.lua
Expand Up @@ -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)
Expand Down

0 comments on commit 5868274

Please sign in to comment.