From 8026025fbdb6d89cd9659c1ab0fd68463cb144f8 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 8 Jan 2025 17:15:05 -0700 Subject: [PATCH 1/3] Improve `LegoRacers` `HitActor` matches (#1318) --- LEGO1/lego/legoomni/src/race/legoracers.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/LEGO1/lego/legoomni/src/race/legoracers.cpp b/LEGO1/lego/legoomni/src/race/legoracers.cpp index f16a488c..14afc7f9 100644 --- a/LEGO1/lego/legoomni/src/race/legoracers.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracers.cpp @@ -517,11 +517,12 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool) } } - if (p_bool && m_worldSpeed != 0) { - return SUCCESS; + if (p_bool) { + return m_worldSpeed != 0 ? SUCCESS : FAILURE; + } + else { + return FAILURE; } - - return FAILURE; } } @@ -717,11 +718,12 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool) } } - if (p_bool && m_worldSpeed != 0) { - return SUCCESS; + if (p_bool) { + return m_worldSpeed != 0 ? SUCCESS : FAILURE; + } + else { + return FAILURE; } - - return FAILURE; } } From 646ee0d70ac9ac36ef1d13cc16bd4fe3aed9506c Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 8 Jan 2025 17:15:29 -0700 Subject: [PATCH 2/3] Use `COMPAT_MODE` to fix inline function not defined warnings on modern compilers (#1315) * Use `COMPAT_MODE` to fix inline function not defined * Fix --- LEGO1/realtime/matrix.h | 4 ++++ LEGO1/realtime/vector.h | 6 ++++++ LEGO1/realtime/vector4d.inl.h | 3 +++ 3 files changed, 13 insertions(+) diff --git a/LEGO1/realtime/matrix.h b/LEGO1/realtime/matrix.h index c792f4da..307f4ce5 100644 --- a/LEGO1/realtime/matrix.h +++ b/LEGO1/realtime/matrix.h @@ -52,4 +52,8 @@ class Matrix4 { const float* operator[](int idx) const { return m_data[idx]; } }; +#ifdef COMPAT_MODE +#include "matrix4d.inl.h" +#endif + #endif // MATRIX_H diff --git a/LEGO1/realtime/vector.h b/LEGO1/realtime/vector.h index defaab57..3841783f 100644 --- a/LEGO1/realtime/vector.h +++ b/LEGO1/realtime/vector.h @@ -148,4 +148,10 @@ class Vector4 : public Vector3 { friend class Mx4DPointFloat; }; +#ifdef COMPAT_MODE +#include "vector2d.inl.h" +#include "vector3d.inl.h" +#include "vector4d.inl.h" +#endif + #endif // VECTOR_H diff --git a/LEGO1/realtime/vector4d.inl.h b/LEGO1/realtime/vector4d.inl.h index a94e8f09..7bfce62d 100644 --- a/LEGO1/realtime/vector4d.inl.h +++ b/LEGO1/realtime/vector4d.inl.h @@ -3,6 +3,9 @@ #include "vector.h" +#include +#include + // FUNCTION: LEGO1 0x10002870 void Vector4::AddImpl(const float* p_value) { From 5cd365c4f18f52cb76990d315840019813c4fe8c Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 8 Jan 2025 17:28:43 -0700 Subject: [PATCH 3/3] Order until the end of `LegoAnimActor` (#1319) --- LEGO1/lego/legoomni/src/actors/islepathactor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp index 4ae6272a..c1b5694a 100644 --- a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp +++ b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp @@ -19,9 +19,6 @@ DECOMP_SIZE_ASSERT(IslePathActor, 0x160) DECOMP_SIZE_ASSERT(IslePathActor::SpawnLocation, 0x38) -// GLOBAL: LEGO1 0x10102b28 -IslePathActor::SpawnLocation g_spawnLocations[IslePathActor::c_LOCATIONS_NUM]; - // FUNCTION: LEGO1 0x1001a200 IslePathActor::IslePathActor() { @@ -157,6 +154,9 @@ void IslePathActor::Exit() FUN_1003eda0(); } +// GLOBAL: LEGO1 0x10102b28 +IslePathActor::SpawnLocation g_spawnLocations[IslePathActor::c_LOCATIONS_NUM]; + // FUNCTION: LEGO1 0x1001a700 void IslePathActor::RegisterSpawnLocations() {