]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - builtin/mainmenu/tab_online.lua
Merge branch 'master' into master
[dragonfireclient.git] / builtin / mainmenu / tab_online.lua
index 8e88a7743eb7ed72dd50fa5c8528bb5b1a327bcb..7985fd84a02dc915ca49f9dbf528119880670c8a 100644 (file)
@@ -20,7 +20,7 @@ local function get_formspec(tabview, name, tabdata)
        -- Update the cached supported proto info,
        -- it may have changed after a change by the settings menu.
        common_update_cached_supp_proto()
-       local fav_selected = nil
+       local fav_selected
        if menudata.search_result then
                fav_selected = menudata.search_result[tabdata.fav_selected]
        else
@@ -36,7 +36,7 @@ local function get_formspec(tabview, name, tabdata)
                "field[0.15,0.075;5.91,1;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
                "button[5.62,-0.25;1.5,1;btn_mp_search;" .. fgettext("Search") .. "]" ..
                "image_button[6.97,-.165;.83,.83;" .. core.formspec_escape(defaulttexturedir .. "refresh.png")
-                       .. ";btn_mp_refresh;" .. fgettext("") .. "]" ..
+                       .. ";btn_mp_refresh;]" ..
 
                -- Address / Port
                "label[7.75,-0.25;" .. fgettext("Address / Port") .. "]" ..
@@ -78,6 +78,7 @@ local function get_formspec(tabview, name, tabdata)
                "text,align=right,padding=0.25;" ..   -- clients_max
                image_column(fgettext("Creative mode"), "creative") .. ",padding=1;" ..
                image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
+               --~ PvP = Player versus Player
                image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
                "color,span=1;" ..
                "text,padding=1]" ..
@@ -256,6 +257,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
                -- setup the keyword list
                local keywords = {}
                for word in input:gmatch("%S+") do
+                       word = word:gsub("(%W)", "%%%1")
                        table.insert(keywords, word)
                end
 
@@ -272,8 +274,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
                        for k = 1, #keywords do
                                local keyword = keywords[k]
                                if server.name then
-                                       local name = server.name:lower()
-                                       local _, count = name:gsub(keyword, keyword)
+                                       local sername = server.name:lower()
+                                       local _, count = sername:gsub(keyword, keyword)
                                        found = found + count * 4
                                end