From bc9d225c898b7fa87d7088f6a9f4a582f2eed8dd Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 21 Jun 2018 19:11:20 -1000 Subject: [PATCH] Fix boost ball and other collision issues --- Runtime/Collision/CAreaOctTree.hpp | 2 +- Runtime/World/CMorphBall.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Runtime/Collision/CAreaOctTree.hpp b/Runtime/Collision/CAreaOctTree.hpp index 294940815..94403e2b7 100644 --- a/Runtime/Collision/CAreaOctTree.hpp +++ b/Runtime/Collision/CAreaOctTree.hpp @@ -93,7 +93,7 @@ public: ETreeType GetChildType(int idx) const { u16 flags = *reinterpret_cast(x18_ptr); - return ETreeType((flags << (2 * idx)) & 0x3); + return ETreeType((flags >> (2 * idx)) & 0x3); } ETreeType GetTreeType() const { return x20_nodeType; } diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index 44d5de39c..62310d385 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -1274,7 +1274,7 @@ void CMorphBall::UpdateEffects(float dt, CStateManager& mgr) else { x1c34_boostLightFactor = std::max(x1de8_boostChargeTime / g_tweakBall->GetBoostBallMaxChargeTime(), - x1c34_boostLightFactor); + x1c34_boostLightFactor); x1c34_boostLightFactor = std::min(x1c34_boostLightFactor, 1.f); } UpdateMorphBallTransitionFlash(dt); @@ -1735,7 +1735,8 @@ void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) co } else { - x58_ballModel->Render(mgr, ballToWorld, nullptr, flags); + // Lights used to be nullptr here, but we keep it due to PC's increased dynamic lighting range + x58_ballModel->Render(mgr, ballToWorld, lights, flags); } if (x1c1c_rainSplashGen && x1c1c_rainSplashGen->IsRaining())