1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Merge pull request #20847 from ZehMatt/fix-20846

Fix #20843: Remove 0 padding from file path in scenario index filename
This commit is contained in:
Matt
2023-10-04 22:07:49 +03:00
committed by GitHub

View File

@@ -155,6 +155,15 @@ protected:
void Serialise(DataSerialiser& ds, const ScenarioIndexEntry& item) const override void Serialise(DataSerialiser& ds, const ScenarioIndexEntry& item) const override
{ {
ds << item.Path; ds << item.Path;
if (ds.IsLoading())
{
// Field used to be fixed size length, remove the 0 padding.
const auto pos = item.Path.find('\0');
if (pos != std::string::npos)
{
const_cast<ScenarioIndexEntry&>(item).Path = item.Path.substr(0, pos);
}
}
ds << item.Timestamp; ds << item.Timestamp;
ds << item.Category; ds << item.Category;
ds << item.SourceGame; ds << item.SourceGame;