Finish Destroy

This commit is contained in:
Christian Semmler 2024-01-17 12:20:59 -05:00
parent 582fd88709
commit 0428af89b7
2 changed files with 17 additions and 6 deletions

View File

@ -24,6 +24,8 @@ class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name);
}
virtual void Destroy() override; // vtable+0x38
private:
void Init();
void Destroy(MxBool p_fromDestructor);

View File

@ -17,18 +17,27 @@ LegoHideAnimPresenter::~LegoHideAnimPresenter()
// FUNCTION: LEGO1 0x1006da50
void LegoHideAnimPresenter::Init()
{
this->m_unk0xc0 = NULL;
m_unk0xc0 = NULL;
}
// STUB: LEGO1 0x1006da60
// FUNCTION: LEGO1 0x1006da60
void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor)
{
m_criticalSection.Enter();
if (!this->m_unk0xc0)
delete this->m_unk0xc0;
if (m_unk0xc0)
delete m_unk0xc0;
Init();
m_criticalSection.Leave();
// if (!p_fromDestructor)
// TODO: another function
// This appears to be a bug, since it results in an endless loop
if (!p_fromDestructor)
LegoHideAnimPresenter::Destroy();
}
// FUNCTION: LEGO1 0x1006dac0
void LegoHideAnimPresenter::Destroy()
{
Destroy(FALSE);
}