mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-26 03:52:00 +02:00
fixed distance sort
This commit is contained in:
parent
231e151870
commit
8706bb6ce2
@ -140,6 +140,22 @@ local function get_sorted_list(sort_by)
|
|||||||
player_list[i2] = a
|
player_list[i2] = a
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if sort_by == "distance_asc" then
|
||||||
|
if global.scenario.variables.player_walk_distances[player_list[i].name] > global.scenario.variables.player_walk_distances[player_list[i2].name] then
|
||||||
|
local a = player_list[i]
|
||||||
|
local b = player_list[i2]
|
||||||
|
player_list[i] = b
|
||||||
|
player_list[i2] = a
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if sort_by == "distance_desc" then
|
||||||
|
if global.scenario.variables.player_walk_distances[player_list[i].name] < global.scenario.variables.player_walk_distances[player_list[i2].name] then
|
||||||
|
local a = player_list[i]
|
||||||
|
local b = player_list[i2]
|
||||||
|
player_list[i] = b
|
||||||
|
player_list[i2] = a
|
||||||
|
end
|
||||||
|
end
|
||||||
if sort_by == "name_asc" then
|
if sort_by == "name_asc" then
|
||||||
if player_list[i].name > player_list[i2].name then
|
if player_list[i].name > player_list[i2].name then
|
||||||
local a = player_list[i]
|
local a = player_list[i]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user