Skip to content

Commit d0a6cac

Browse files
kilbithparamat
authored andcommittedFeb 18, 2017
Multiplayer menu: fix attempt to open nonexistant image
Since local servers and local favorites have no ping value (these are only provided by the server) we shouldn't load a broken image filename. Fixes #5238
1 parent e9cd718 commit d0a6cac

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

Diff for: ‎builtin/mainmenu/common.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ end
5454
function image_column(tooltip, flagname)
5555
return "image,tooltip=" .. core.formspec_escape(tooltip) .. "," ..
5656
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
57-
"1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_" .. flagname .. ".png") .. "," ..
57+
"1=" .. core.formspec_escape(defaulttexturedir ..
58+
(flagname and "server_flags_" .. flagname .. ".png" or "blank.png")) .. "," ..
5859
"2=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," ..
5960
"3=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," ..
6061
"4=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," ..

Diff for: ‎builtin/mainmenu/tab_multiplayer.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ local function get_formspec(tabview, name, tabdata)
6969
--favourites
7070
retval = retval .. "tablecolumns[" ..
7171
image_column(fgettext("Favorite"), "favorite") .. ";" ..
72-
image_column(fgettext("Ping"), "") .. ",padding=0.25;" ..
72+
image_column(fgettext("Ping")) .. ",padding=0.25;" ..
7373
"color,span=3;" ..
7474
"text,align=right;" .. -- clients
7575
"text,align=center,padding=0.25;" .. -- "/"

0 commit comments

Comments
 (0)
Please sign in to comment.