mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 07:43:01 +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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user