From 7263c739d2b5a1e8622c8d8d7cb106a97cedc70a Mon Sep 17 00:00:00 2001 From: ivanPyrohivskyi Date: Thu, 9 Jan 2025 17:48:27 +0200 Subject: [PATCH] Fix missing maps --- .../MissingMapsCalculator.mm | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm b/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm index 0c2f522a5b..ae8daf9370 100644 --- a/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm +++ b/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm @@ -133,9 +133,13 @@ - (BOOL)checkIfThereAreMissingMaps:(std::shared_ptr)ctx { if (p.hhEditions == nil) { - if ([p.regions count] > 0) + for (NSString * r in p.regions) { - [mapsToDownload addObject:[p.regions objectAtIndex:0]]; + if (![self isRoadOnlyMap:r]) + { + [mapsToDownload addObject:r]; + break; + } } } else if (checkHHEditions) @@ -415,4 +419,16 @@ - (NSString *)getErrorMessage return msg; } +- (BOOL) isRoadOnlyMap:(NSString *)regionName +{ + if (_or != nil) + { + OAWorldRegion * wr = [_or getRegionDataByDownloadName:regionName]; + if (wr != nil) + { + return ![wr regionMap] && [wr regionRoads]; + } + } +} + @end