From 67dfb30ead28e0738627cd8dff5c19507e82d307 Mon Sep 17 00:00:00 2001 From: ANAND Date: Sat, 9 Nov 2019 08:56:39 +0530 Subject: [PATCH] Map maker: Fix crash when submitting fields in /gui --- mods/ctf/ctf_map/map_maker.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ctf/ctf_map/map_maker.lua b/mods/ctf/ctf_map/map_maker.lua index 5a8fc40..087b306 100644 --- a/mods/ctf/ctf_map/map_maker.lua +++ b/mods/ctf/ctf_map/map_maker.lua @@ -20,7 +20,7 @@ local config = { center = storage:get_string("center"), flags = storage:get_string("flags"), barrier_r = storage:get_int("barrier_r"), - barrier_rot = storage:get_int("barrier_rot"), + barrier_rot = storage:get_string("barrier_rot"), barriers_placed = storage:get_int("barriers_placed") == 1 } @@ -222,7 +222,8 @@ local function show_gui(name) "label[0,2.8;2. Place Barriers]", "label[0.1,3.3;This may take a few minutes.]", "field[0.4,4.3;1,1;barrier_r;R;", config.barrier_r, "]", - "dropdown[1.15,4.05;1,1;barrier_rot;X=0,Z=0;", config.barrier_rot + 1, "]", + "dropdown[1.15,4.05;1,1;barrier_rot;X=0,Z=0;", + config.barrier_rot == "x" and 1 or 2, "]", "button[2.3,4;2,1;place_barrier;Place Barriers]", "box[4.4,2.8;0.05,2.2;#111111BB]", @@ -307,7 +308,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.barrier_rot and fields.barrier_rot ~= "" then config.barrier_rot = fields.barrier_rot == "X=0" and "x" or "z" - storage:set_int("config.barrier_rot", config.barrier_rot) + storage:set_string("barrier_rot", config.barrier_rot) end if fields.set_center then