@@ -3413,16 +3413,15 @@ void AHuman::Update()
3413
3413
m_ThrowTmr.Reset ();
3414
3414
if (!pThrown->ActivatesWhenReleased ()) { pThrown->Activate (); }
3415
3415
}
3416
+ float throwProgress = GetThrowProgress ();
3416
3417
m_ArmsState = THROWING_PREP;
3417
- m_pFGArm->ReachToward (m_pFGArm->GetJointPos () + pThrown->GetStartThrowOffset ().RadRotate (m_AimAngle + m_AngularVel * deltaTime). GetXFlipped (m_HFlipped ));
3418
+ m_pFGArm->ReachToward (m_pFGArm->GetJointPos () + ( pThrown->GetStartThrowOffset ().GetXFlipped (m_HFlipped) * throwProgress + pThrown-> GetStanceOffset () * ( 1 . 0F - throwProgress)). RadRotate (adjustedAimAngle ));
3418
3419
} else if (m_ArmsState == THROWING_PREP) {
3419
3420
m_ArmsState = THROWING_RELEASE;
3420
3421
// TODO: figure out how to properly use EndThrowOffset, since it doesn't play much a role for just one frame!
3421
3422
m_pFGArm->SetHandPos (m_pFGArm->GetJointPos () + pThrown->GetEndThrowOffset ().RadRotate (adjustedAimAngle).GetXFlipped (m_HFlipped));
3422
3423
3423
- MovableObject *pMO = m_pFGArm->ReleaseHeldMO ();
3424
-
3425
- if (pMO) {
3424
+ if (MovableObject *pMO = m_pFGArm->ReleaseHeldMO ()) {
3426
3425
pMO->SetPos (m_pFGArm->GetJointPos () + Vector (m_pFGArm->GetMaxLength () * GetFlipFactor (), -m_pFGArm->GetMaxLength () * 0 .5F ).RadRotate (adjustedAimAngle));
3427
3426
float maxThrowVel = pThrown->GetMaxThrowVel ();
3428
3427
float minThrowVel = pThrown->GetMinThrowVel ();
@@ -3858,7 +3857,8 @@ void AHuman::Update()
3858
3857
HeldDevice *heldDevice = dynamic_cast <HeldDevice *>(GetEquippedItem ());
3859
3858
ThrownDevice *thrownDevice = dynamic_cast <ThrownDevice *>(heldDevice);
3860
3859
if (thrownDevice && (m_ArmsState == THROWING_PREP || isSharpAiming)) {
3861
- m_pBGArm->ReachToward (m_pBGArm->GetJointPos () + thrownDevice->GetEndThrowOffset ().RadRotate (m_AimAngle).GetXFlipped (m_HFlipped));
3860
+ float throwProgress = isSharpAiming ? 1 .0F : GetThrowProgress ();
3861
+ m_pBGArm->ReachToward (m_pBGArm->GetJointPos () + (thrownDevice->GetEndThrowOffset ().GetXFlipped (m_HFlipped) * throwProgress + (thrownDevice->GetStanceOffset () + thrownDevice->GetSupportOffset ().GetXFlipped (m_HFlipped)) * (1 .0F - throwProgress)).RadRotate (adjustedAimAngle));
3862
3862
} else if (heldDevice) {
3863
3863
if (GetEquippedBGItem () && !heldDevice->IsOneHanded ()) {
3864
3864
UnequipBGArm ();
0 commit comments