diff --git a/LEGO1/lego/legoomni/include/policestate.h b/LEGO1/lego/legoomni/include/policestate.h index be55ecae..517710ab 100644 --- a/LEGO1/lego/legoomni/include/policestate.h +++ b/LEGO1/lego/legoomni/include/policestate.h @@ -26,6 +26,8 @@ class PoliceState : public LegoState { // SYNTHETIC: LEGO1 0x1005e920 // PoliceState::`scalar deleting destructor' + virtual MxResult VTable0x1c(LegoFileStream* p_legoFileStream) override; // vtable+0x1C + private: undefined4 m_unk0x8; // 0x8 undefined4 m_unk0xc; // 0xc diff --git a/LEGO1/lego/legoomni/src/police/policestate.cpp b/LEGO1/lego/legoomni/src/police/policestate.cpp index 4965a36f..b0011ccb 100644 --- a/LEGO1/lego/legoomni/src/police/policestate.cpp +++ b/LEGO1/lego/legoomni/src/police/policestate.cpp @@ -10,3 +10,21 @@ PoliceState::PoliceState() m_unk0xc = 0; m_unk0x8 = (rand() % 2 == 0) ? 501 : 500; } + +// FUNCTION: LEGO1 0x1005e990 +MxResult PoliceState::VTable0x1c(LegoFileStream* p_legoFileStream) +{ + if (p_legoFileStream->IsWriteMode()) { + p_legoFileStream->FUN_10006030(ClassName()); + } + + if (p_legoFileStream->IsReadMode()) { + p_legoFileStream->Read(&m_unk0x8, sizeof(m_unk0x8)); + } + else { + undefined4 unk0x8 = m_unk0x8; + p_legoFileStream->Write(&unk0x8, sizeof(m_unk0x8)); + } + + return SUCCESS; +} diff --git a/LEGO1/lego/legoomni/src/towtrack/towtrackmissionstate.cpp b/LEGO1/lego/legoomni/src/towtrack/towtrackmissionstate.cpp index 8d3d56b9..a5719da5 100644 --- a/LEGO1/lego/legoomni/src/towtrack/towtrackmissionstate.cpp +++ b/LEGO1/lego/legoomni/src/towtrack/towtrackmissionstate.cpp @@ -28,18 +28,6 @@ MxResult TowTrackMissionState::VTable0x1c(LegoFileStream* p_legoFileStream) } if (p_legoFileStream->IsReadMode()) { - p_legoFileStream->Write(&m_unk0x12, sizeof(MxU16)); - p_legoFileStream->Write(&m_unk0x14, sizeof(MxU16)); - p_legoFileStream->Write(&m_unk0x16, sizeof(MxU16)); - p_legoFileStream->Write(&m_unk0x18, sizeof(MxU16)); - p_legoFileStream->Write(&m_unk0x1a, sizeof(MxU16)); - p_legoFileStream->Write(&m_unk0x1c, sizeof(MxU16)); - p_legoFileStream->Write(&m_color1, sizeof(MxU16)); - p_legoFileStream->Write(&m_color2, sizeof(MxU16)); - p_legoFileStream->Write(&m_color3, sizeof(MxU16)); - p_legoFileStream->Write(&m_color4, sizeof(MxU16)); - } - else if (p_legoFileStream->IsWriteMode()) { p_legoFileStream->Read(&m_unk0x12, sizeof(MxU16)); p_legoFileStream->Read(&m_unk0x14, sizeof(MxU16)); p_legoFileStream->Read(&m_unk0x16, sizeof(MxU16)); @@ -51,6 +39,37 @@ MxResult TowTrackMissionState::VTable0x1c(LegoFileStream* p_legoFileStream) p_legoFileStream->Read(&m_color3, sizeof(MxU16)); p_legoFileStream->Read(&m_color4, sizeof(MxU16)); } + else if (p_legoFileStream->IsWriteMode()) { + MxU16 write = m_unk0x12; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_unk0x14; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_unk0x16; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_unk0x18; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_unk0x1a; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_unk0x1c; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_color1; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_color2; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_color3; + p_legoFileStream->Write(&write, sizeof(MxU16)); + + write = m_color4; + p_legoFileStream->Write(&write, sizeof(MxU16)); + } return SUCCESS; }