From d25f4fa9a327d07cf820a6332753a069c978bc70 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 6 Sep 2019 09:40:14 -0400 Subject: [PATCH] MP1/CFlaahgraTentacle: Amend sphere collision list appending This was always using the first element in the array to append t the output joint list, resulting in incorrect names and radius values. --- Runtime/MP1/World/CFlaahgraTentacle.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Runtime/MP1/World/CFlaahgraTentacle.cpp b/Runtime/MP1/World/CFlaahgraTentacle.cpp index f1b648760..967c85f9b 100644 --- a/Runtime/MP1/World/CFlaahgraTentacle.cpp +++ b/Runtime/MP1/World/CFlaahgraTentacle.cpp @@ -84,15 +84,17 @@ void CFlaahgraTentacle::Think(float dt, CStateManager& mgr) { void CFlaahgraTentacle::AddSphereCollisionList(const SSphereJointInfo* sphereJoints, s32 jointCount, std::vector& outJoints) { - const CAnimData* animData = GetModelData()->GetAnimationData(); - for (u32 i = 0; i < jointCount; ++i) { - CSegId segId = animData->GetLocatorSegId(sphereJoints[i].name); - if (segId == 0xFF) + for (s32 i = 0; i < jointCount; ++i) { + const SSphereJointInfo& sphereJoint = sphereJoints[i]; + const CSegId segId = animData->GetLocatorSegId(sphereJoint.name); + + if (segId == 0xFF) { continue; - outJoints.push_back( - CJointCollisionDescription::SphereCollision(segId, sphereJoints->radius, sphereJoints->name, 10.f)); + } + + outJoints.push_back(CJointCollisionDescription::SphereCollision(segId, sphereJoint.radius, sphereJoint.name, 10.f)); } }