diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index 786235e98b..887b0dff8c 100644 --- a/src/openrct2/title/TitleSequence.cpp +++ b/src/openrct2/title/TitleSequence.cpp @@ -54,7 +54,7 @@ extern "C" TitleSequence * LoadTitleSequence(const utf8 * path) { size_t scriptLength; - char * script; + utf8 * script; std::vector saves; bool isZip; @@ -70,7 +70,7 @@ extern "C" return nullptr; } - script = (char *)zip->GetFileData("script.txt", &scriptLength); + script = (utf8 *)zip->GetFileData("script.txt", &scriptLength); if (script == nullptr) { Console::Error::WriteLine("Unable to open script.txt in '%s'", path); @@ -88,7 +88,7 @@ extern "C" utf8 scriptPath[MAX_PATH]; String::Set(scriptPath, sizeof(scriptPath), path); Path::Append(scriptPath, sizeof(scriptPath), "script.txt"); - script = (char *)ReadScriptFile(scriptPath, &scriptLength); + script = (utf8 *)ReadScriptFile(scriptPath, &scriptLength); if (script == nullptr) { Console::Error::WriteLine("Unable to open '%s'", scriptPath); @@ -100,6 +100,7 @@ extern "C" } std::vector commands = LegacyScriptRead(script, scriptLength, saves); + Memory::Free(script); TitleSequence * seq = CreateTitleSequence(); seq->Name = Path::GetFileNameWithoutExtension(path);