From b4c562d765eeebfac494b6f3d195450b65c4be65 Mon Sep 17 00:00:00 2001 From: Morten Fredriksen Date: Sun, 19 Mar 2023 16:04:23 +0100 Subject: [PATCH] Fix map selection bug --- backend/api/Services/MapService.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/api/Services/MapService.cs b/backend/api/Services/MapService.cs index da760b206..ec7218fa3 100644 --- a/backend/api/Services/MapService.cs +++ b/backend/api/Services/MapService.cs @@ -270,11 +270,9 @@ private static bool CheckMapIsHigherResolution( List referenceMap ) { - if (checkMap[0][0] < referenceMap[0][0] | checkMap[0][1] < referenceMap[0][1]) - { - return false; - } - if (checkMap[1][0] > referenceMap[1][0] | checkMap[1][1] > referenceMap[1][1]) + double checkMapArea = (checkMap[1][0] - checkMap[0][0]) * (checkMap[1][1] - checkMap[0][1]); + double referenceMapArea = (referenceMap[1][0] - referenceMap[0][0]) * (referenceMap[1][1] - referenceMap[0][1]); + if (checkMapArea > referenceMapArea) { return false; }