From f0e69bda77d883643e52ae38ecfdfed0e5ca7337 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Thu, 30 Jan 2020 16:45:40 -0700 Subject: [PATCH] if the first list happened to be empty when the formspec is opened it would crash, initializing to pos 0 to prevent that. --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 4dfb2e1..ede496a 100644 --- a/init.lua +++ b/init.lua @@ -481,6 +481,8 @@ local function get_formspec(player_name) end formspec[#formspec] = ";"..state.row_index.."]" -- don't use +1, this overwrites the last "," + state.selected_pos = state.selected_pos or {x=0,y=0,z=0} + formspec[#formspec+1] = "container[0.5,5.25]" .."label[0,0.15;X]field[0.25,0;1,0.25;pos_x;;"..state.selected_pos.x.."]" .."label[1.5,0.15;Y]field[1.75,0;1,0.25;pos_y;;"..state.selected_pos.y.."]"