aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/common.lua
diff options
context:
space:
mode:
authorkilbith <jeanpatrick.guerrero@gmail.com>2017-02-16 20:14:49 -0800
committerparamat <mat.gregory@virginmedia.com>2017-02-18 22:46:45 +0000
commitd0a6cacd51a25f75b0b2e9133514c7cf40a36805 (patch)
tree59e65555c2cd1df1a75f4322bbf09210260b8a48 /builtin/mainmenu/common.lua
parente9cd7187e88b05a3e972b781cd85ef1e4f2bc10b (diff)
downloadminetest-d0a6cacd51a25f75b0b2e9133514c7cf40a36805.tar.gz
minetest-d0a6cacd51a25f75b0b2e9133514c7cf40a36805.tar.bz2
minetest-d0a6cacd51a25f75b0b2e9133514c7cf40a36805.zip
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
Diffstat (limited to 'builtin/mainmenu/common.lua')
-rw-r--r--builtin/mainmenu/common.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua
index 17d910e8b..57950c62c 100644
--- a/builtin/mainmenu/common.lua
+++ b/builtin/mainmenu/common.lua
@@ -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") .. "," ..