diff --git a/builtin/fstk/ui.lua b/builtin/fstk/ui.lua index 71b9427de..6961545c7 100644 --- a/builtin/fstk/ui.lua +++ b/builtin/fstk/ui.lua @@ -79,16 +79,16 @@ end -------------------------------------------------------------------------------- function ui.update() local formspec = "" + local restart_btn -- handle errors - if gamedata ~= nil and gamedata.reconnect_requested then - if core.settings:get_bool("auto_connect") == true then - gamedata.reconnect_requested = false - gamedata.errormessage = nil - gamedata.do_reconnect = true - core.start() - return - end + if gamedata ~= nil and gamedata.errormessage ~= nil and core.settings:get_bool("auto_connect") == true then + gamedata.reconnect_requested = false + gamedata.errormessage = nil + gamedata.do_reconnect = true + core.start() + return + elseif gamedata ~= nil and gamedata.reconnect_requested then formspec = wordwrap_quickhack(gamedata.errormessage or "") formspec = "size[12,5]" .. "label[0.5,0;" .. fgettext("The server has requested a reconnect:") .. diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index 34663317c..2643815ba 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -114,6 +114,7 @@ local function main_button_handler(this, fields, name, tabdata) gamedata.port = fields["te_serverport"] gamedata.address = "" + core.settings:set_bool("auto_connect", false) core.settings:set("port",gamedata.port) if fields["te_serveraddr"] ~= nil then core.settings:set("bind_address",fields["te_serveraddr"])