1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix #20843: Remove 0 padding from file path in scenario index filename

This commit is contained in:
ζeh Matt
2023-10-04 04:36:00 +03:00
parent 39ecab4bd2
commit cdb9f4cd18

View File

@@ -155,6 +155,15 @@ protected:
void Serialise(DataSerialiser& ds, const ScenarioIndexEntry& item) const override
{
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.Category;
ds << item.SourceGame;