From fd0e11fac039871b2494ec19872223a2560300d8 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Fri, 10 Dec 2021 16:36:32 +0000 Subject: [PATCH] Handle pl3xmap world ordering --- src/providers/Pl3xmapMapProvider.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/providers/Pl3xmapMapProvider.ts b/src/providers/Pl3xmapMapProvider.ts index e6bf5f3..1276fe0 100644 --- a/src/providers/Pl3xmapMapProvider.ts +++ b/src/providers/Pl3xmapMapProvider.ts @@ -97,7 +97,10 @@ export default class Pl3xmapMapProvider extends MapProvider { this.worldMarkerUpdateIntervals.clear(); this.worldPlayerUpdateIntervals.clear(); - (serverResponse.worlds || []).filter((w: any) => w && !!w.name).forEach((world: any, index: number) => { + const filteredWorlds = (serverResponse.worlds || []).filter((w: any) => w && !!w.name) + .sort((a: any, b: any) => a.order - b.order); + + filteredWorlds.forEach((world: any, index: number) => { const worldResponse = worldResponses[index], worldConfig: {components: LiveAtlasPartialComponentConfig } = { components: {},