1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Fix normalisation writing files to unknown location

This commit is contained in:
duncanspumpkin
2020-04-10 07:55:52 +01:00
parent 4f0d9a6363
commit 1395b9a9c1

View File

@@ -1511,6 +1511,14 @@ static int32_t cc_replay_normalise(InteractiveConsole& console, const arguments_
std::string inputFile = argv[0];
std::string outputFile = argv[1];
if (!String::EndsWith(outputFile, ".sv6r", true))
{
outputFile += ".sv6r";
}
std::string outPath = OpenRCT2::GetContext()->GetPlatformEnvironment()->GetDirectoryPath(
OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::REPLAY);
outputFile = Path::Combine(outPath, outputFile);
auto* replayManager = OpenRCT2::GetContext()->GetReplayManager();
if (replayManager->NormaliseReplay(inputFile, outputFile))
{