Match LegoGameState::Save

This commit is contained in:
Christian Semmler 2024-02-27 14:18:29 -05:00
parent da050a3e43
commit 51c5956e41

View File

@ -199,25 +199,10 @@ MxResult LegoGameState::Save(MxULong p_slot)
goto done; goto done;
} }
{ WriteScalar(&fileStream, 0x1000c);
MxU32 version = 0x1000C; WriteScalar(&fileStream, m_unk0x24);
((LegoStorage*) &fileStream)->Write(&version, sizeof(version)); WriteScalar(&fileStream, (MxU16) m_currentAct);
} WriteScalar(&fileStream, m_actorId);
{
MxU16 unk0x24 = m_unk0x24;
((LegoStorage*) &fileStream)->Write(&unk0x24, sizeof(unk0x24));
}
{
MxU16 act = m_currentAct;
((LegoStorage*) &fileStream)->Write(&act, sizeof(act));
}
{
MxU8 actorId = m_actorId;
((LegoStorage*) &fileStream)->Write(&actorId, sizeof(actorId));
}
for (i = 0; i < _countof(g_colorSaveData); i++) { for (i = 0; i < _countof(g_colorSaveData); i++) {
if (WriteVariable(&fileStream, variableTable, g_colorSaveData[i].m_targetName) == FAILURE) { if (WriteVariable(&fileStream, variableTable, g_colorSaveData[i].m_targetName) == FAILURE) {
@ -243,10 +228,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
} }
} }
{ WriteScalar(&fileStream, count);
MxU16 c = count;
((LegoStorage*) &fileStream)->Write(&c, sizeof(c));
}
for (j = 0; j < m_stateCount; j++) { for (j = 0; j < m_stateCount; j++) {
if (m_stateArray[j]->VTable0x14()) { if (m_stateArray[j]->VTable0x14()) {
@ -255,7 +237,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
} }
area = m_unk0x42c; area = m_unk0x42c;
Write(&fileStream, &area); WriteScalar(&fileStream, (MxU16) area);
SerializeScoreHistory(2); SerializeScoreHistory(2);
m_isDirty = FALSE; m_isDirty = FALSE;