Skip to content

Commit

Permalink
Fix #2046: Bone rotating bugs (#2088)
Browse files Browse the repository at this point in the history
  • Loading branch information
jey-banned committed Mar 22, 2021
1 parent 0b65b39 commit 9706481
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Client/game_sa/CEntitySA.cpp
Expand Up @@ -678,6 +678,11 @@ bool CEntitySA::SetBoneRotation(eBone boneId, float yaw, float pitch, float roll
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
RwV3d angles = {yaw, roll, pitch};
BoneNode_cSAInterface::EulerToQuat(&angles, boneOrientation);
CEntitySAInterface* theInterface = GetInterface();
if (theInterface)
{
theInterface->bDontUpdateHierarchy = false;
}
return true;
}
}
Expand Down
9 changes: 9 additions & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp
Expand Up @@ -1040,6 +1040,15 @@ bool CLuaPedDefs::UpdateElementRpHAnim(lua_State* const luaVM, CClientEntity* en
if (theEntity)
{
theEntity->UpdateRpHAnim();

if (theEntity->GetModelIndex() == 0) // CJ skin
{
RpClump* clump = theEntity->GetRpClump();
if (clump)
{
((void(__cdecl*)(RpClump*))0x5DF560)(clump); // CPed::ShoulderBoneRotation
}
}
return true;
}
return false;
Expand Down

0 comments on commit 9706481

Please sign in to comment.