From 8574357c0bf853a331c81abc44d49b229c4c229d Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 27 Feb 2024 14:22:18 -0500 Subject: [PATCH] Spacing --- .../lego/legoomni/src/common/legogamestate.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 4487515e..80437bd4 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -250,23 +250,29 @@ MxResult LegoGameState::DeleteState() { MxS16 stateCount = m_stateCount; LegoState** stateArray = m_stateArray; + m_stateCount = 0; m_stateArray = NULL; + if (stateCount > 0) { MxS32 count = stateCount; - LegoState** iter = stateArray; + LegoState** it = stateArray; + do { - if (!(*iter)->SetFlag() && (*iter)->VTable0x14()) { - delete *iter; + if (!(*it)->SetFlag() && (*it)->VTable0x14()) { + delete *it; } else { - RegisterState(*iter); - *iter = NULL; + RegisterState(*it); + *it = NULL; } - iter++; + + it++; } while (--count); } + delete[] stateArray; + return SUCCESS; }