Use u8string for ScenarioIndexEntry Path

This commit is contained in:
ζeh Matt 2023-08-10 14:38:35 +03:00
parent ed32fd2567
commit 67d51c3584
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
2 changed files with 7 additions and 7 deletions

View File

@ -204,10 +204,10 @@ private:
{
auto& objRepository = OpenRCT2::GetContext()->GetObjectRepository();
auto importer = ParkImporter::CreateParkFile(objRepository);
importer->LoadScenario(path.c_str(), true);
importer->LoadScenario(path, true);
if (importer->GetDetails(entry))
{
String::Set(entry->Path, sizeof(entry->Path), path.c_str());
entry->Path = path;
entry->Timestamp = timestamp;
result = true;
}
@ -225,10 +225,10 @@ private:
try
{
auto s4Importer = ParkImporter::CreateS4();
s4Importer->LoadScenario(path.c_str(), true);
s4Importer->LoadScenario(path, true);
if (s4Importer->GetDetails(entry))
{
String::Set(entry->Path, sizeof(entry->Path), path.c_str());
entry->Path = path;
entry->Timestamp = timestamp;
result = true;
}
@ -273,7 +273,7 @@ private:
ScenarioIndexEntry entry = {};
// Set new entry
String::Set(entry.Path, sizeof(entry.Path), path.c_str());
entry.Path = path;
entry.Timestamp = timestamp;
entry.Category = s6Info->Category;
entry.ObjectiveType = s6Info->ObjectiveType;
@ -562,7 +562,7 @@ private:
if (existingEntry->Timestamp > entry.Timestamp)
{
// Existing entry is more recent
conflictPath = String::ToStd(existingEntry->Path);
conflictPath = existingEntry->Path;
// Overwrite existing entry with this one
*existingEntry = entry;

View File

@ -42,7 +42,7 @@ enum class ScenarioSource : uint8_t
struct ScenarioIndexEntry
{
utf8 Path[MAX_PATH];
u8string Path;
uint64_t Timestamp;
// Category / sequence