fixed crash when player leave during the join server

This commit is contained in:
crabman77 2015-06-28 16:30:05 +02:00
parent fe2bf3e822
commit d77c9ab5ff
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ local function add_buttons(player, formspec)
formspec = player:get_inventory_formspec()
end
local w,h = get_formspec_size(formspec)
if not w or not h then
return
end
for i=1,#tweak.buttons do
formspec = formspec .. "button["..w-(0.8+(i*0.8))..",0.2;" .. tweak.buttons[i]
end