From 22ba12593a2595bdd017023cd074b058287fddf5 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Thu, 29 May 2025 19:40:36 -0400 Subject: [PATCH] dComIfG_Ccsp_SetMass --- include/d/d_com_inf_game.h | 8 ++++++++ src/d/actor/d_a_arrow.cpp | 8 ++------ src/d/actor/d_a_bk.cpp | 12 +++--------- src/d/actor/d_a_bomb2.cpp | 4 +--- src/d/actor/d_a_bomb3.inc | 16 ++++------------ src/d/actor/d_a_hookshot.cpp | 8 ++------ src/d/actor/d_a_player_main.cpp | 20 ++++++-------------- 7 files changed, 26 insertions(+), 50 deletions(-) diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index d2a403cb8..b0c494fdb 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -3971,6 +3971,14 @@ inline dCcS* dComIfG_Ccsp() { return &g_dComIfG_gameInfo.play.mCcS; } +// This should be dComIfG_Ccsp()->SetMass everywhere, but for some reason that combination of two +// inlines consistently breaks the match on retail. But for the demo, using the proper inlines is requires to match. +#if VERSION == VERSION_DEMO +#define dComIfG_Ccsp_SetMass dComIfG_Ccsp()->SetMass +#else +#define dComIfG_Ccsp_SetMass dComIfG_Ccsp()->mMass_Mng.Set +#endif + inline void dComIfG_setTimerMode(int ms) { g_dComIfG_gameInfo.play.setTimerMode(ms); } inline int dComIfG_getTimerMode() { return g_dComIfG_gameInfo.play.getTimerMode(); } diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index 059adc4d0..2e454da69 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -298,9 +298,7 @@ void daArrow_c::arrowShooting() { mAtCps.CalcAtVec(); dComIfG_Ccsp()->Set(&mAtCps); - // Using the dComIfG_Ccsp inline here breaks the match. - // dComIfG_Ccsp()->SetMass(&mCps, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mAtCps, 1); + dComIfG_Ccsp_SetMass(&mAtCps, 1); clrAtHitNormal(); setAtHitPosBuff(&end); @@ -874,9 +872,7 @@ BOOL daArrow_c::procMove() { mAtCps.CalcAtVec(); dComIfG_Ccsp()->Set(&mAtCps); - // Using the dComIfG_Ccsp inline here breaks the match. - // dComIfG_Ccsp()->SetMass(&mCps, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mAtCps, 1); + dComIfG_Ccsp_SetMass(&mAtCps, 1); } return TRUE; diff --git a/src/d/actor/d_a_bk.cpp b/src/d/actor/d_a_bk.cpp index 27a204559..3c6986c98 100644 --- a/src/d/actor/d_a_bk.cpp +++ b/src/d/actor/d_a_bk.cpp @@ -2134,9 +2134,7 @@ static fopAc_ac_c* yari_hit_check(bk_class* i_this) { i_this->m1040.MoveCAt(i_this->m11A8); dComIfG_Ccsp()->Set(&i_this->m1040); if (i_this->m02D5 != 0) { - // Using the dComIfG_Ccsp inline here breaks the match. - // dComIfG_Ccsp()->SetMass(&i_this->m1040, 3); - dComIfG_Ccsp()->mMass_Mng.Set(&i_this->m1040, 3); + dComIfG_Ccsp_SetMass(&i_this->m1040, 3); } if (i_this->m1040.ChkAtHit()) { i_this->m0B78 = 5; @@ -3334,9 +3332,7 @@ static void Bk_move(bk_class* i_this) { i_this->m1040.OffAtVsPlayerBit(); i_this->m1040.SetAtSpl(dCcG_At_Spl_UNK1); dComIfG_Ccsp()->Set(&i_this->m1040); - // Using the dComIfG_Ccsp inline here breaks the match. - // dComIfG_Ccsp()->SetMass(&i_this->m1040, 3); - dComIfG_Ccsp()->mMass_Mng.Set(&i_this->m1040, 3); + dComIfG_Ccsp_SetMass(&i_this->m1040, 3); if (i_this->m1040.ChkAtHit() && actor->speed.y < -50.0f) { actor->speed.y = 0.0f; @@ -4422,9 +4418,7 @@ static BOOL daBk_Execute(bk_class* i_this) { MtxPosition(&sp58, &sp4C); i_this->m0B88.SetC(sp4C); dComIfG_Ccsp()->Set(&i_this->m0B88); - // Using the inline breaks the match. - // dComIfG_Ccsp()->SetMass(&i_this->m0B88, 3); - dComIfG_Ccsp()->mMass_Mng.Set(&i_this->m0B88, 3); + dComIfG_Ccsp_SetMass(&i_this->m0B88, 3); cXyz sp40 = i_this->m116C; cXyz sp34 = i_this->current.pos; diff --git a/src/d/actor/d_a_bomb2.cpp b/src/d/actor/d_a_bomb2.cpp index 212ca1e58..9e49ca1b2 100644 --- a/src/d/actor/d_a_bomb2.cpp +++ b/src/d/actor/d_a_bomb2.cpp @@ -477,9 +477,7 @@ namespace daBomb2 { mSph.SetR(radius); mSph.SetC(pos); dComIfG_Ccsp()->Set(&mSph); - //using inline breaks match - //dComIfG_Ccsp()->SetMass(&mSph, 3); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSph, 3); + dComIfG_Ccsp_SetMass(&mSph, 3); } } diff --git a/src/d/actor/d_a_bomb3.inc b/src/d/actor/d_a_bomb3.inc index 506a1e977..05f2b0184 100644 --- a/src/d/actor/d_a_bomb3.inc +++ b/src/d/actor/d_a_bomb3.inc @@ -672,9 +672,7 @@ void daBomb_c::makeWaterEffect() { mSph.SetC(current.pos); if(mMassCounter != g_Counter.mCounter0) { dComIfG_Ccsp()->Set(&mSph); - //using inline breaks match - //dComIfG_Ccsp()->SetMass(&mSph, 3); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSph, 3); + dComIfG_Ccsp_SetMass(&mSph, 3); mMassCounter = g_Counter.mCounter0; field_0x782 = 1; } @@ -834,9 +832,7 @@ BOOL daBomb_c::procExplode_init() { mSph.SetC(current.pos); if(mMassCounter != g_Counter.mCounter0) { dComIfG_Ccsp()->Set(&mSph); - //using inline breaks match - //dComIfG_Ccsp()->SetMass(&mSph, 3); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSph, 3); + dComIfG_Ccsp_SetMass(&mSph, 3); field_0x782 = 1; mMassCounter = g_Counter.mCounter0; } @@ -899,9 +895,7 @@ bool daBomb_c::procExplode() { mSph.SetC(current.pos); if(mMassCounter != g_Counter.mCounter0) { dComIfG_Ccsp()->Set(&mSph); - //using inline breaks match - //dComIfG_Ccsp()->SetMass(&mSph, 3); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSph, 3); + dComIfG_Ccsp_SetMass(&mSph, 3); mMassCounter = g_Counter.mCounter0; field_0x782 = 1; } @@ -1088,9 +1082,7 @@ BOOL daBomb_c::execute() { mSph.SetR(scale.x * 30.0f); if(mMassCounter != g_Counter.mCounter0) { dComIfG_Ccsp()->Set(&mSph); - //using inline breaks match - //dComIfG_Ccsp()->SetMass(&mSph, 3); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSph, 3); + dComIfG_Ccsp_SetMass(&mSph, 3); mMassCounter = g_Counter.mCounter0; } } diff --git a/src/d/actor/d_a_hookshot.cpp b/src/d/actor/d_a_hookshot.cpp index 74ba55f30..a811da7fa 100644 --- a/src/d/actor/d_a_hookshot.cpp +++ b/src/d/actor/d_a_hookshot.cpp @@ -186,9 +186,7 @@ BOOL daHookshot_c::procWait() { mSightCps.SetR(5.0f); mSightCps.CalcAtVec(); dComIfG_Ccsp()->Set(&mSightCps); - // Using the inline breaks the match. - // dComIfG_Ccsp()->SetMass(&mSightCps, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSightCps, 1); + dComIfG_Ccsp_SetMass(&mSightCps, 1); m2A3 = false; mCurrProcFunc = &daHookshot_c::procShot; @@ -298,9 +296,7 @@ BOOL daHookshot_c::procShot() { mSightCps.SetR(5.0f); mSightCps.CalcAtVec(); dComIfG_Ccsp()->Set(&mSightCps); - // Using the inline breaks the match. - // dComIfG_Ccsp()->SetMass(&mSightCps, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mSightCps, 1); + dComIfG_Ccsp_SetMass(&mSightCps, 1); current.pos = sp8C; } diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 38ab16d8a..5cc86e824 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -9817,10 +9817,7 @@ void daPy_lk_c::setCollision() { mCyl.OnTgSetBit(); } dComIfG_Ccsp()->Set(&mCyl); - // Using the dComIfG_Ccsp inline here (and everywhere else - // in this function) breaks the match. - // dComIfG_Ccsp()->SetMass(&mCyl, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mCyl, 1); + dComIfG_Ccsp_SetMass(&mCyl, 1); mWindCyl.SetC(spD0); mWindCyl.SetH(mCyl.GetH()); mWindCyl.SetR(mCyl.GetR()); @@ -10074,14 +10071,12 @@ void daPy_lk_c::setCollision() { } } dComIfG_Ccsp()->Set(&mAtCyl); - // dComIfG_Ccsp()->SetMass(&mAtCyl, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mAtCyl, 1); + dComIfG_Ccsp_SetMass(&mAtCyl, 1); int i; dCcD_Cps* pdVar21 = &mAtCps[0]; for (i = 0; i < 3; i++, pdVar21++) { dComIfG_Ccsp()->Set(pdVar21); - // dComIfG_Ccsp()->SetMass(&pdVar21, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(pdVar21, 1); + dComIfG_Ccsp_SetMass(pdVar21, 1); } } else { if (mSwBlur.field_0x014 < 10) { @@ -10200,8 +10195,7 @@ void daPy_lk_c::setCollision() { mFanWindCps.SetAtVec(spC4); mFanWindCps.SetR(in_f31); dComIfG_Ccsp()->Set(&mFanWindCps); - // dComIfG_Ccsp()->SetMass(&mFanWindCps, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mFanWindCps, 1); + dComIfG_Ccsp_SetMass(&mFanWindCps, 1); } else { mFanWindCps.ResetAtHit(); } @@ -10217,8 +10211,7 @@ void daPy_lk_c::setCollision() { mFanWindSph.SetC(current.pos); } dComIfG_Ccsp()->Set(&mFanWindSph); - // dComIfG_Ccsp()->SetMass(&mFanWindSph, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mFanWindSph, 1); + dComIfG_Ccsp_SetMass(&mFanWindSph, 1); m353A--; } else { mFanWindSph.ResetAtHit(); @@ -10237,8 +10230,7 @@ void daPy_lk_c::setCollision() { mFanLightCps.SetAtVec(local_118); mFanLightCps.OnAtSetBit(); dComIfG_Ccsp()->Set(&mFanLightCps); - // dComIfG_Ccsp()->SetMass(&mFanLightCps, 1); - g_dComIfG_gameInfo.play.mCcS.SetMass(&mFanLightCps, 1); + dComIfG_Ccsp_SetMass(&mFanLightCps, 1); } else { mFanLightCps.ResetAtHit(); mFanLightCps.OffAtSetBit();