Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 72afdff

Browse files
committed
Fix bug caused by cd446ca, that made humans not swap equipment after throwing a TDExplosive
1 parent e4a8b95 commit 72afdff

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Entities/AHuman.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3400,9 +3400,6 @@ void AHuman::Update()
34003400
}
34013401
if (thrownDevice->ActivatesWhenReleased()) { thrownDevice->Activate(); }
34023402
m_ThrowTmr.Reset();
3403-
} else {
3404-
//m_pFGArm->SetHandIdleRotation(adjustedAimAngle);
3405-
//m_pFGArm->AddHandTarget("Stance Offset", m_pFGArm->GetJointPos() + thrownDevice->GetStanceOffset().RadRotate(adjustedAimAngle)); //TODO this can probably be replaced non-targeted handling, especially if I let you rotate idle offsets. Make sure to fix arm so TDs aren't excluded, to make this happen
34063403
}
34073404
} else if (m_ArmsState == THROWING_RELEASE && m_ThrowTmr.GetElapsedSimTimeMS() > 100) {
34083405
m_pFGArm->SetHeldDevice(dynamic_cast<HeldDevice *>(SwapNextInventory()));
@@ -3413,6 +3410,13 @@ void AHuman::Update()
34133410
m_pFGArm->AddHandTarget("Adjusted Aim Angle", m_Pos + Vector(m_pFGArm->GetMaxLength() * GetFlipFactor(), -m_pFGArm->GetMaxLength() * 0.5F).RadRotate(adjustedAimAngle));
34143411
}
34153412
}
3413+
} else if (m_ArmsState == THROWING_RELEASE && m_ThrowTmr.GetElapsedSimTimeMS() > 100) {
3414+
m_pFGArm->SetHeldDevice(dynamic_cast<HeldDevice *>(SwapNextInventory()));
3415+
m_pFGArm->SetHandPos(m_Pos + RotateOffset(m_HolsterOffset));
3416+
EquipShieldInBGArm();
3417+
m_ArmsState = WEAPON_READY;
3418+
} else if (m_ArmsState == THROWING_RELEASE) {
3419+
m_pFGArm->AddHandTarget("Adjusted Aim Angle", m_Pos + Vector(m_pFGArm->GetMaxLength() * GetFlipFactor(), -m_pFGArm->GetMaxLength() * 0.5F).RadRotate(adjustedAimAngle));
34163420
} else {
34173421
m_CanActivateBGItem = true;
34183422
}

0 commit comments

Comments
 (0)