diff options
| author | sfan5 <sfan5@live.de> | 2022-10-17 20:05:14 +0200 |
|---|---|---|
| committer | sfan5 <sfan5@live.de> | 2022-10-17 20:16:39 +0200 |
| commit | 23e9f5db4330a6efee5270160a3959422926ce77 (patch) | |
| tree | ff312e4f57471e1bf24f2427f03ea5b53bc2ed9c /builtin | |
| parent | 862419c76f7f5c7525d9ac3238a6f807de1181a1 (diff) | |
| download | minetest-23e9f5db4330a6efee5270160a3959422926ce77.tar.xz | |
Fix list sorting behaviour with missing geoip
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/mainmenu/serverlistmgr.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/mainmenu/serverlistmgr.lua b/builtin/mainmenu/serverlistmgr.lua index 06dc15777..ab686ded0 100644 --- a/builtin/mainmenu/serverlistmgr.lua +++ b/builtin/mainmenu/serverlistmgr.lua @@ -81,9 +81,9 @@ local function order_server_list(list) -- second: estimated latency local ping = (fav.ping or 0) * 1000 if ping < 400 then - -- If ping is over 400ms, assume the server has latency issues - -- anyway and don't estimate - ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or ping + -- If ping is under 400ms replace it with our own estimate, + -- we assume the server has latency issues anyway otherwise + ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or 0 end s2:push(fav, -ping) end @@ -148,6 +148,9 @@ function serverlistmgr.sync() nil, function(result) geoip_downloading = false + if not result then + return + end serverlistmgr.my_continent = result core.set_once("continent", result) -- reorder list if we already have it |
