Skip to content

Commit 4d4b926

Browse files
fix mismatched teleport/waypoint selection
1 parent a3e6096 commit 4d4b926

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

bridge/search.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ local function show_formspec(playername, data)
9191
return a.distance < b.distance
9292
end)
9393

94-
-- store as last result
95-
search_results[playername] = data
94+
-- data to store as last result
95+
local last_result_data = {}
9696

9797
-- render list items
9898
for _, item in ipairs(data) do
@@ -140,6 +140,10 @@ local function show_formspec(playername, data)
140140
item.description = description
141141

142142
if add_to_list then
143+
-- result data
144+
table.insert(last_result_data, item)
145+
146+
-- formspec data
143147
list = list .. "," ..
144148
color .. "," ..
145149
distance .. "," ..
@@ -150,6 +154,9 @@ local function show_formspec(playername, data)
150154

151155
end
152156

157+
-- store filtered result data
158+
search_results[playername] = last_result_data
159+
153160
list = list .. ";]"
154161

155162
local teleport_button = ""

0 commit comments

Comments
 (0)