From 4b372120f10fb5617ec5630801e16246fd06ad10 Mon Sep 17 00:00:00 2001 From: woj1993 Date: Fri, 13 Apr 2018 12:29:31 +0200 Subject: [PATCH] Fix #6141: CSS50.dat is never loaded (#7357) --- distribution/changelog.txt | 1 + src/openrct2/Context.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 48ca947de3..3504dabe6c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,7 @@ - Fix: [#3596] Saving parks, landscapes and tracks with a period in the filenames don't get their extension. - Fix: [#5210] Default system dialog not accessible from saving landscape window. - Fix: [#6134] Scenarios incorrectly categorised when using Polish version of RCT2. +- Fix: [#6141] CSS50.dat is never loaded. - Fix: [#7176] Mechanics sometimes fall down from rides. - Fix: [#7303] Visual glitch with virtual floor near map edges. - Fix: [#7327] Abstract scenery and stations don't get fully See-Through when hiding them (original bug). diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 01bea28502..c49da24781 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -274,8 +274,16 @@ namespace OpenRCT2 std::string result; if (pathId == PATH_ID_CSS50) { - auto dataPath = _env->GetDirectoryPath(DIRBASE::RCT1, DIRID::DATA); - result = Path::Combine(dataPath, "css17.dat"); + if (!(_env->GetDirectoryPath(DIRBASE::RCT1).empty())) + { + auto dataPath = _env->GetDirectoryPath(DIRBASE::RCT1, DIRID::DATA); + result = Path::Combine(dataPath, "css17.dat"); + } + else + { + auto dataPath = _env->GetDirectoryPath(DIRBASE::RCT2, DIRID::DATA); + result = Path::Combine(dataPath, "css50.dat"); + } } else if (pathId >= 0 && pathId < PATH_ID_END) {