projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c824d69
)
Creative: Fix crash when turning on creative in-game
author
Rui
<rui.minetest@gmail.com>
Sat, 5 Nov 2016 02:58:13 +0000
(11:58 +0900)
committer
paramat
<mat.gregory@virginmedia.com>
Mon, 7 Nov 2016 14:13:10 +0000
(14:13 +0000)
mods/creative/init.lua
patch
|
blob
|
history
diff --git
a/mods/creative/init.lua
b/mods/creative/init.lua
index 24cd673b76576d0912d8e74c65532748482e7128..d90426da0d60215e26de90e9fee04221ceb002b3 100644
(file)
--- 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)