diff --git a/include/MetroidPrime/Weapons/CGunWeapon.hpp b/include/MetroidPrime/Weapons/CGunWeapon.hpp index 6fa48f1f..e35622c6 100644 --- a/include/MetroidPrime/Weapons/CGunWeapon.hpp +++ b/include/MetroidPrime/Weapons/CGunWeapon.hpp @@ -78,6 +78,7 @@ public: virtual void Unload(CStateManager& mgr); virtual bool IsLoaded() const; + const CVelocityInfo& GetVelocityInfo() const { return x1d0_velInfo; } rstl::optional_object< CModelData >& SolidModelData() { return x10_solidModelData; } CAABox GetBounds() const; diff --git a/src/MetroidPrime/Player/CPlayerGun.cpp b/src/MetroidPrime/Player/CPlayerGun.cpp index 282d7ef1..635d4f12 100644 --- a/src/MetroidPrime/Player/CPlayerGun.cpp +++ b/src/MetroidPrime/Player/CPlayerGun.cpp @@ -562,11 +562,13 @@ void CPlayerGun::InitMuzzleData() { } } -void CPlayerGun::InitCTData() { - x77c_comboXferGen = rstl::auto_ptr< CElementGen >(); -} +void CPlayerGun::InitCTData() { x77c_comboXferGen = rstl::auto_ptr< CElementGen >(); } -float CPlayerGun::GetBeamVelocity() const { return 0.0f; } +float CPlayerGun::GetBeamVelocity() const { + if (x72c_currentBeam->IsLoaded()) + return x72c_currentBeam->GetVelocityInfo().GetVelocity(int(x330_chargeState)).GetY(); + return 10.f; +} TUniqueId CPlayerGun::GetTargetId(CStateManager&) { return TUniqueId(0, 0); }