diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp index 8f2f12449..8d43b9714 100644 --- a/examples/SharedMemory/PhysicsClientC_API.cpp +++ b/examples/SharedMemory/PhysicsClientC_API.cpp @@ -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;