From 5293b3683ee51a624d69be574e7352337a7eccdc Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 29 Jul 2021 15:12:30 +0200 Subject: [PATCH] Fix macOS compilation (hopefully) --- src/openrct2/ParkFile.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index 41d557f5d2..cade9af83d 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -4424,14 +4425,16 @@ static const FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& de if (desc.Generation == ObjectGeneration::JSON) { auto datPathName = GetDATPathName(desc.Identifier); - if (datPathName == std::nullopt) + if (datPathName.has_value()) + { + rct_object_entry objectEntry = {}; + objectEntry.SetName(datPathName.value()); + return GetFootpathSurfaceId(ObjectEntryDescriptor(objectEntry)); + } + else { return nullptr; } - - rct_object_entry objectEntry = {}; - objectEntry.SetName(datPathName.value()); - return GetFootpathSurfaceId(ObjectEntryDescriptor(objectEntry)); } // Even old .park saves with DAT identifiers somehow exist.