From 8706bb6ce289e2d125ec5edb61b8a61cc49e7496 Mon Sep 17 00:00:00 2001 From: Valansch Date: Wed, 19 Jul 2017 12:12:50 +0200 Subject: [PATCH] fixed distance sort --- player_list.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/player_list.lua b/player_list.lua index e8d2a58e..71f366b9 100644 --- a/player_list.lua +++ b/player_list.lua @@ -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]