mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #20843: Remove 0 padding from file path in scenario index filename
This commit is contained in:
parent
39ecab4bd2
commit
cdb9f4cd18
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue