Skip to content

Commit

Permalink
Merge remote-tracking branch 'isle/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtacles committed Jul 2, 2024
2 parents 3819dd0 + 788cec2 commit af51373
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 19 deletions.
53 changes: 50 additions & 3 deletions LEGO1/lego/legoomni/src/worlds/gasstation.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "gasstation.h"

#include "garage_actions.h"
#include "isle.h"
#include "islepathactor.h"
#include "jukebox.h"
#include "jukebox_actions.h"
Expand All @@ -10,6 +11,7 @@
#include "legomain.h"
#include "legoutils.h"
#include "misc.h"
#include "mxactionnotificationparam.h"
#include "mxbackgroundaudiomanager.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
Expand Down Expand Up @@ -299,11 +301,56 @@ inline void GasStation::StopAction(GarageScript::Script p_objectId)
}
}

// STUB: LEGO1 0x10005660
// FUNCTION: LEGO1 0x10005660
MxLong GasStation::HandleEndAction(MxEndActionNotificationParam& p_param)
{
// TODO
return 0;
MxLong result = m_radio.Notify(p_param);

if (result == 0) {
MxDSAction* action = p_param.GetAction();

if (action->GetAtomId() == m_atom && action->GetObjectId()) {
m_state->FUN_10006460((GarageScript::Script) action->GetObjectId());
m_unk0x106 = 0;

switch (m_state->m_unk0x14.m_unk0x00) {
case 5:
g_unk0x100f0160 = 0;
m_state->m_unk0x14.m_unk0x00 = 6;
m_unk0x115 = TRUE;
PlayAction(GarageScript::c_wgs023nu_RunAnim);
m_unk0x106 = 1;
m_unk0x104 = 1;
break;
case 6:
g_unk0x100f0160 = 0;
m_unk0x115 = TRUE;

if (m_unk0x104 == 3) {
m_state->m_unk0x14.m_unk0x00 = 8;
PlayAction(GarageScript::c_wgs029nu_RunAnim);
m_unk0x106 = 1;
}
else {
m_state->m_unk0x14.m_unk0x00 = 7;
m_unk0x114 = TRUE;
}
break;
case 8:
m_state->m_unk0x14.m_unk0x00 = 2;
((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 = 7;
m_destLocation = LegoGameState::e_unk28;
m_radio.Stop();
BackgroundAudioManager()->Stop();
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
break;
}

result = 1;
}
}

return result;
}

// FUNCTION: LEGO1 0x10005920
Expand Down
27 changes: 11 additions & 16 deletions LEGO1/omni/include/mxactionnotificationparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ class MxActionNotificationParam : public MxNotificationParam {
: MxNotificationParam(p_type, p_sender)
{
MxDSAction* oldAction = p_action;
this->m_realloc = p_reallocAction;
m_realloc = p_reallocAction;

if (p_reallocAction) {
this->m_action = new MxDSAction();
m_action = new MxDSAction();
}
else {
this->m_action = oldAction;
m_action = oldAction;
return;
}

this->m_action->SetAtomId(oldAction->GetAtomId());
this->m_action->SetObjectId(oldAction->GetObjectId());
this->m_action->SetUnknown24(oldAction->GetUnknown24());
m_action->SetAtomId(oldAction->GetAtomId());
m_action->SetObjectId(oldAction->GetObjectId());
m_action->SetUnknown24(oldAction->GetUnknown24());
}

// FUNCTION: LEGO1 0x10051050
inline ~MxActionNotificationParam() override
{
if (!this->m_realloc) {
if (!m_realloc) {
return;
}

if (this->m_action) {
delete this->m_action;
if (m_action) {
delete m_action;
}
}

// FUNCTION: LEGO1 0x100510c0
MxNotificationParam* Clone() const override
{
return new MxActionNotificationParam(this->m_type, this->m_sender, this->m_action, this->m_realloc);
return new MxActionNotificationParam(m_type, m_sender, m_action, m_realloc);
} // vtable+0x04

inline MxDSAction* GetAction() { return m_action; }
Expand Down Expand Up @@ -93,12 +93,7 @@ class MxEndActionNotificationParam : public MxActionNotificationParam {
// FUNCTION: LEGO1 0x10051270
MxNotificationParam* Clone() const override
{
return new MxEndActionNotificationParam(
c_notificationEndAction,
this->m_sender,
this->m_action,
this->m_realloc
);
return new MxEndActionNotificationParam(c_notificationEndAction, m_sender, m_action, m_realloc);
} // vtable+0x04
};

Expand Down

0 comments on commit af51373

Please sign in to comment.