1
0
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:
Valansch 2017-07-19 12:12:50 +02:00
parent 231e151870
commit 8706bb6ce2

View File

@ -140,6 +140,22 @@ local function get_sorted_list(sort_by)
player_list[i2] = a
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 player_list[i].name > player_list[i2].name then
local a = player_list[i]