forked from minetest/minetest_game
Creative: Fix crash when turning on creative in-game
This commit is contained in:
parent
c824d69182
commit
5868274b00
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user