Skip to content

Commit

Permalink
Multiplayer menu: fix attempt to open nonexistant image
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kilbith authored and paramat committed Feb 18, 2017
1 parent e9cd718 commit d0a6cac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion builtin/mainmenu/common.lua
Expand Up @@ -54,7 +54,8 @@ end
function image_column(tooltip, flagname)
return "image,tooltip=" .. core.formspec_escape(tooltip) .. "," ..
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
"1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_" .. flagname .. ".png") .. "," ..
"1=" .. core.formspec_escape(defaulttexturedir ..
(flagname and "server_flags_" .. flagname .. ".png" or "blank.png")) .. "," ..
"2=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," ..
"3=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," ..
"4=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," ..
Expand Down
2 changes: 1 addition & 1 deletion builtin/mainmenu/tab_multiplayer.lua
Expand Up @@ -69,7 +69,7 @@ local function get_formspec(tabview, name, tabdata)
--favourites
retval = retval .. "tablecolumns[" ..
image_column(fgettext("Favorite"), "favorite") .. ";" ..
image_column(fgettext("Ping"), "") .. ",padding=0.25;" ..
image_column(fgettext("Ping")) .. ",padding=0.25;" ..
"color,span=3;" ..
"text,align=right;" .. -- clients
"text,align=center,padding=0.25;" .. -- "/"
Expand Down

0 comments on commit d0a6cac

Please sign in to comment.