From dc6b7b42a449245b42053d1d25149eb692016ee8 Mon Sep 17 00:00:00 2001 From: Pyro Nicampt <81565698+PyroNicampt@users.noreply.github.com> Date: Sun, 8 Feb 2026 03:17:58 -0600 Subject: [PATCH] fix marker sorting --- js/mapdata.js | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/js/mapdata.js b/js/mapdata.js index a00ae3d..36504fe 100644 --- a/js/mapdata.js +++ b/js/mapdata.js @@ -108,30 +108,28 @@ export function sortMarkers(){ } function markerSortFunction(a, b){ - (a,b) => { - if(a.type == 'player') return 1; - if(b.type == 'player') return -1; - if(a.type == b.type){ - switch(a.type){ - case 'speed': - return b.value-a.value; - default: - return 0; - } + if(a.type == 'player') return 1; + if(b.type == 'player') return -1; + if(a.type == b.type){ + switch(a.type){ + case 'speed': + return b.value-a.value; + default: + return 0; } - if(a.type == 'station') return 1; - if(b.type == 'station') return -1; - if(a.type == 'speed') return 1; - if(b.type == 'speed') return -1; - if(a.type == 'junction') return 1; - if(b.type == 'junction') return -1; - if(a.type == 'service') return 1; - if(b.type == 'service') return -1; - - if(a.type == 'demonstratorSpawnHint') return -1; - if(b.type == 'demonstratorSpawnHint') return 1; - return 0; } + if(a.type == 'station') return 1; + if(b.type == 'station') return -1; + if(a.type == 'speed') return 1; + if(b.type == 'speed') return -1; + if(a.type == 'junction') return 1; + if(b.type == 'junction') return -1; + if(a.type == 'service') return 1; + if(b.type == 'service') return -1; + + if(a.type == 'demonstratorSpawnHint') return -1; + if(b.type == 'demonstratorSpawnHint') return 1; + return 0; } export function sortShops(){