Menu: Fix starting a server if the server address is an empty string. (#5742)
authorred-001 <red-001@outlook.ie>
Wed, 10 May 2017 21:25:45 +0000 (22:25 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Wed, 10 May 2017 21:25:45 +0000 (23:25 +0200)
Minetest uses an empty string internal to signal that a server should be started.

builtin/mainmenu/tab_multiplayer.lua

index a9b2b35fed8352ee4f035f68a468a5a495300a60..f40b707ac57c075e2602cad06352247e93093c10 100644 (file)
@@ -299,7 +299,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
                return true
        end
 
-       if (fields.btn_mp_connect or fields.key_enter) and fields.te_address and fields.te_port then
+       if (fields.btn_mp_connect or fields.key_enter)
+                       and fields.te_address ~= "" and fields.te_port then
                gamedata.playername = fields.te_name
                gamedata.password   = fields.te_pwd
                gamedata.address    = fields.te_address