Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/behavior' into behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
siliconsniffer committed Feb 7, 2025
2 parents eb87904 + f9d5b85 commit d940137
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions builtin/mainmenu/tab_online.lua
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,35 @@ local function search_server_list(input)
return a.points > b.points
end)
menudata.search_result = search_result
<<<<<<< HEAD
=======

-- Keep current selection if it's in search results
local found_current = false
if current_server then
for _, server in ipairs(search_result) do
if server.address == current_server.address and
server.port == current_server.port then
found_current = true
break
end
end
end

-- If current selection isn't in results, select first compatible server
if not found_current then
-- Find first compatible server (favorite or public)
for _, server in ipairs(search_result) do
if is_server_protocol_compat(server.proto_min, server.proto_max) then
set_selected_server(server)
return
end
end
-- If no compatible server found, clear selection
set_selected_server(nil)
end
end
>>>>>>> origin/behavior

-- Keep current selection if it's in search results
local found_current = false
Expand Down

0 comments on commit d940137

Please sign in to comment.