From e781b71f5c2325f632f1aa229a6cbe598987bc36 Mon Sep 17 00:00:00 2001 From: jonschz Date: Sun, 30 Jun 2024 10:41:01 +0200 Subject: [PATCH] Implement several functions --- LEGO1/lego/legoomni/include/legoracecar.h | 2 +- LEGO1/lego/legoomni/src/race/legoracecar.cpp | 26 ++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoracecar.h b/LEGO1/lego/legoomni/include/legoracecar.h index 18504c72..632f52bb 100644 --- a/LEGO1/lego/legoomni/include/legoracecar.h +++ b/LEGO1/lego/legoomni/include/legoracecar.h @@ -46,7 +46,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { override; // vtable+0x98 MxResult VTable0x9c() override; // vtable+0x9c - virtual void FUN_10012ea0(float p_worldSpeed); + virtual void SetMaxLinearVelocity(float p_maxLinearVelocity); virtual void FUN_10012ff0(float); virtual MxBool FUN_10013130(float); diff --git a/LEGO1/lego/legoomni/src/race/legoracecar.cpp b/LEGO1/lego/legoomni/src/race/legoracecar.cpp index ead26c64..593d569f 100644 --- a/LEGO1/lego/legoomni/src/race/legoracecar.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracecar.cpp @@ -18,35 +18,41 @@ LegoRaceCar::LegoRaceCar() NotificationManager()->Register(this); } -// STUB: LEGO1 0x10012c80 +// FUNCTION: LEGO1 0x10012c80 LegoRaceCar::~LegoRaceCar() { - // TODO + NotificationManager()->Unregister(this); } -// STUB: LEGO1 0x10012d90 +// FUNCTION: LEGO1 0x10012d90 MxLong LegoRaceCar::Notify(MxParam& p_param) { - // TODO - return 0; + return LegoRaceMap::Notify(p_param); } -// STUB: LEGO1 0x10012e60 +// FUNCTION: LEGO1 0x10012e60 void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed) { - // TODO + if (!m_userNavFlag) { + if (!LegoCarRaceActor::m_unk0x0c) { + m_maxLinearVel = p_worldSpeed; + } + LegoAnimActor::SetWorldSpeed(p_worldSpeed); + return; + } + m_worldSpeed = p_worldSpeed; } // FUNCTION: LEGO1 0x10012ea0 -void LegoRaceCar::FUN_10012ea0(float p_worldSpeed) +void LegoRaceCar::SetMaxLinearVelocity(float p_maxLinearVelocity) { - if (p_worldSpeed < 0) { + if (p_maxLinearVelocity < 0) { LegoCarRaceActor::m_unk0x0c = 2; m_maxLinearVel = 0; SetWorldSpeed(0); } else { - m_maxLinearVel = p_worldSpeed; + m_maxLinearVel = p_maxLinearVelocity; } }