Implement/match HistoryBook::~HistoryBook (#1139)

This commit is contained in:
Christian Semmler
2024-11-10 09:07:48 -07:00
committed by GitHub
parent 0b94b4803b
commit 40159b43c7
2 changed files with 28 additions and 2 deletions

View File

@@ -21,10 +21,33 @@ HistoryBook::HistoryBook()
NotificationManager()->Register(this);
}
// STUB: LEGO1 0x100824d0
// FUNCTION: LEGO1 0x100824d0
// FUNCTION: BETA10 0x1002b63e
HistoryBook::~HistoryBook()
{
// TODO
for (MxS16 scoreIndex = 0; scoreIndex < GameState()->m_history.GetCount(); scoreIndex++) {
if (m_scores[scoreIndex]) {
delete m_scores[scoreIndex]->GetAction();
delete m_scores[scoreIndex];
m_scores[scoreIndex] = NULL;
}
for (MxS16 letterIndex = 0; letterIndex < (MxS16) sizeOfArray(m_names[0]); letterIndex++) {
if (m_names[scoreIndex][letterIndex]) {
delete m_names[scoreIndex][letterIndex]->GetAction();
delete m_names[scoreIndex][letterIndex];
m_names[scoreIndex][letterIndex] = NULL;
}
}
}
InputManager()->UnRegister(this);
if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
ControlManager()->Unregister(this);
NotificationManager()->Unregister(this);
}
// FUNCTION: LEGO1 0x10082610