Saveload: Fix upstream chunk load state not be cleared before load
This commit is contained in:
@@ -101,6 +101,7 @@ namespace upstream_sl {
|
|||||||
void SlFixPointers();
|
void SlFixPointers();
|
||||||
void SlFixPointerChunkByID(uint32 id);
|
void SlFixPointerChunkByID(uint32 id);
|
||||||
void SlSaveChunkChunkByID(uint32 id);
|
void SlSaveChunkChunkByID(uint32 id);
|
||||||
|
void SlResetLoadState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** What are we currently doing? */
|
/** What are we currently doing? */
|
||||||
@@ -3516,6 +3517,8 @@ static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
|
|||||||
_sl.reader = new ReadBuffer(_sl.lf);
|
_sl.reader = new ReadBuffer(_sl.lf);
|
||||||
_next_offs = 0;
|
_next_offs = 0;
|
||||||
|
|
||||||
|
upstream_sl::SlResetLoadState();
|
||||||
|
|
||||||
if (!load_check) {
|
if (!load_check) {
|
||||||
ResetSaveloadData();
|
ResetSaveloadData();
|
||||||
|
|
||||||
|
@@ -2128,6 +2128,12 @@ void SlSaveChunkChunkByID(uint32 id)
|
|||||||
SlSaveChunk(*ch);
|
SlSaveChunk(*ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Reset state prior to a load */
|
||||||
|
void SlResetLoadState()
|
||||||
|
{
|
||||||
|
_next_offs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
SaveLoadTable SaveLoadHandler::GetLoadDescription() const
|
SaveLoadTable SaveLoadHandler::GetLoadDescription() const
|
||||||
{
|
{
|
||||||
assert(this->load_description.has_value());
|
assert(this->load_description.has_value());
|
||||||
|
Reference in New Issue
Block a user