Merge pull request #16687 from ZehMatt/fix-16617

Fix #16617: Park format storing/loading temporary paused state
This commit is contained in:
ζeh Matt 2022-02-19 19:26:30 -08:00 committed by GitHub
commit 045a78930e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -422,7 +422,18 @@ namespace OpenRCT2
void ReadWriteGeneralChunk(OrcaStream& os)
{
auto found = os.ReadWriteChunk(ParkFileChunkType::GENERAL, [this](OrcaStream::ChunkStream& cs) {
cs.ReadWrite(gGamePaused);
// Only GAME_PAUSED_NORMAL from gGamePaused is relevant.
if (cs.GetMode() == OrcaStream::Mode::READING)
{
const uint8_t isPaused = cs.Read<uint8_t>();
gGamePaused &= ~GAME_PAUSED_NORMAL;
gGamePaused |= (isPaused & GAME_PAUSED_NORMAL);
}
else
{
const uint8_t isPaused = (gGamePaused & GAME_PAUSED_NORMAL);
cs.Write(isPaused);
}
cs.ReadWrite(gCurrentTicks);
cs.ReadWrite(gDateMonthTicks);
cs.ReadWrite(gDateMonthsElapsed);