Merge pull request #1872 from RanTig/GetLinkStateFix

Change b3GetLinkState to use numLinks in status handle
This commit is contained in:
erwincoumans
2018-09-11 08:48:30 -07:00
committed by GitHub

View File

@@ -1008,10 +1008,10 @@ B3_SHARED_API int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemor
int bodyIndex = status->m_sendActualStateArgs.m_bodyUniqueId;
b3Assert(bodyIndex>=0);
b3Assert(linkIndex >= 0);
int numJoints = b3GetNumJoints(physClient,bodyIndex);
b3Assert(linkIndex < numJoints);
int numLinks = status->m_sendActualStateArgs.m_numLinks;
b3Assert(linkIndex < numLinks);
if ((bodyIndex>=0) && (linkIndex >= 0) && linkIndex < numJoints)
if ((bodyIndex>=0) && (linkIndex >= 0) && linkIndex < numLinks)
{
b3Transform wlf,com,inertial;