1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix issues with file finding on Linux

This commit is contained in:
Ted John
2022-05-13 01:04:39 +01:00
parent a1d6492828
commit 2012488956
2 changed files with 23 additions and 14 deletions

View File

@@ -74,7 +74,7 @@ static SourceInfo ParseSource(std::string_view source)
auto env = GetContext()->GetPlatformEnvironment();
auto dataPath = env->GetDirectoryPath(DIRBASE::RCT1, DIRID::DATA);
info.Path = Path::Combine(dataPath, name);
info.Path = Path::ResolveCasing(Path::Combine(dataPath, name));
}
else if (String::StartsWith(source, "$RCT2:DATA/"))
{
@@ -88,7 +88,7 @@ static SourceInfo ParseSource(std::string_view source)
auto env = GetContext()->GetPlatformEnvironment();
auto dataPath = env->GetDirectoryPath(DIRBASE::RCT2, DIRID::DATA);
info.Path = Path::Combine(dataPath, name);
info.Path = Path::ResolveCasing(Path::Combine(dataPath, name));
}
else if (String::StartsWith(source, "$["))
{
@@ -191,8 +191,11 @@ void AudioSampleTable::Unload()
{
for (auto& entry : _entries)
{
entry.Source->Release();
entry.Source = nullptr;
if (entry.Source != nullptr)
{
entry.Source->Release();
entry.Source = nullptr;
}
}
}