From 9da9a9968aedc2e1577eed865af8ddcf6dac0f26 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 29 Sep 2018 13:58:38 +0100 Subject: [PATCH] Add /../share/openrct2 as possible install location This allows AppImage to work correctly. --- src/openrct2/platform/Platform.Linux.cpp | 27 ++++++++++++++---------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp index 1c08b43356..bac2f000dd 100644 --- a/src/openrct2/platform/Platform.Linux.cpp +++ b/src/openrct2/platform/Platform.Linux.cpp @@ -119,19 +119,24 @@ namespace Platform path = Path::Combine(exeDirectory, "data"); if (!Path::DirectoryExists(path)) { - // 3. Try standard system app directories - path = FindInstallPath(); - if (path.empty()) + // 3. Try ${exeDir}/../share/openrct2 + path = Path::Combine(exeDirectory, "../share/openrct2"); + if (!Path::DirectoryExists(path)) { - // 4. Fallback to ${cwd}/data - path = GetCurrentWorkingDirectory(); - if (!path.empty()) + // 4. Try standard system app directories + path = FindInstallPath(); + if (path.empty()) { - path = Path::Combine(path, "data"); - } - else - { - return "/"; + // 5. Fallback to ${cwd}/data + path = GetCurrentWorkingDirectory(); + if (!path.empty()) + { + path = Path::Combine(path, "data"); + } + else + { + return "/"; + } } } }