From a2c5498c2cef09b5027904b0099f31cab2f20ccd Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 16 Jan 2025 15:52:05 -0700 Subject: [PATCH] Match `Act1State::Serialize` --- LEGO1/lego/legoomni/src/worlds/isle.cpp | 28 ++++++++----------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index e8834b33..d904c12e 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -1337,7 +1337,6 @@ MxResult Act1State::Serialize(LegoStorage* p_storage) m_racecarPlane.Serialize(p_storage); if (p_storage->IsWriteMode()) { - // TODO: Seems to match better when using strcmp directly instead of IsPresent if (strcmp(m_helicopterPlane.m_name.GetData(), "")) { if (!m_helicopterWindshield) { WriteDefaultTexture(p_storage, "chwind.gif"); @@ -1414,54 +1413,45 @@ MxResult Act1State::Serialize(LegoStorage* p_storage) } else if (p_storage->IsReadMode()) { if (strcmp(m_helicopterPlane.m_name.GetData(), "")) { - m_helicopterWindshield = ReadNamedTexture(p_storage); - if (m_helicopterWindshield == NULL) { + if ((m_helicopterWindshield = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } - m_helicopterJetLeft = ReadNamedTexture(p_storage); - if (m_helicopterJetLeft == NULL) { + if ((m_helicopterJetLeft = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } - m_helicopterJetRight = ReadNamedTexture(p_storage); - if (m_helicopterJetRight == NULL) { + if ((m_helicopterJetRight = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } } if (strcmp(m_jetskiPlane.m_name.GetData(), "")) { - m_jetskiFront = ReadNamedTexture(p_storage); - if (m_jetskiFront == NULL) { + if ((m_jetskiFront = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } - m_jetskiWindshield = ReadNamedTexture(p_storage); - if (m_jetskiWindshield == NULL) { + if ((m_jetskiWindshield = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } } if (strcmp(m_dunebuggyPlane.m_name.GetData(), "")) { - m_dunebuggyFront = ReadNamedTexture(p_storage); - if (m_dunebuggyFront == NULL) { + if ((m_dunebuggyFront = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } } if (strcmp(m_racecarPlane.m_name.GetData(), "")) { - m_racecarFront = ReadNamedTexture(p_storage); - if (m_racecarFront == NULL) { + if ((m_racecarFront = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } - m_racecarBack = ReadNamedTexture(p_storage); - if (m_racecarBack == NULL) { + if ((m_racecarBack = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } - m_racecarTail = ReadNamedTexture(p_storage); - if (m_racecarTail == NULL) { + if ((m_racecarTail = ReadNamedTexture(p_storage)) == NULL) { return FAILURE; } }