Skip to content

Commit 441740e

Browse files
red-001nerzhul
authored andcommittedMay 10, 2017
Menu: Fix starting a server if the server address is an empty string. (#5742)
Minetest uses an empty string internal to signal that a server should be started.
1 parent 071e114 commit 441740e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎builtin/mainmenu/tab_multiplayer.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
299299
return true
300300
end
301301

302-
if (fields.btn_mp_connect or fields.key_enter) and fields.te_address and fields.te_port then
302+
if (fields.btn_mp_connect or fields.key_enter)
303+
and fields.te_address ~= "" and fields.te_port then
303304
gamedata.playername = fields.te_name
304305
gamedata.password = fields.te_pwd
305306
gamedata.address = fields.te_address

3 commit comments

Comments
 (3)

orwell96 commented on May 11, 2017

@orwell96
Contributor

What happens if fields.te_address is nil?

red-001 commented on May 11, 2017

@red-001
ContributorAuthor

AFAIK that's not possible unless the field is removed from the serverlist sub-menu.

orwell96 commented on May 12, 2017

@orwell96
Contributor

it might happen if the form is quit. this exits the main menu by default, and fields.te_port is also nil then, so no problem, but just for consistency

Please sign in to comment.