@@ -1298,7 +1298,7 @@ bool AHuman::UnequipBGArm() {
12981298 if (m_pBGArm) {
12991299 if (HeldDevice *heldDevice = m_pBGArm->GetHeldDevice ()) {
13001300 heldDevice->Deactivate ();
1301- AddToInventoryBack (m_pBGArm->RemoveAttachable (heldDevice));
1301+ AddToInventoryFront (m_pBGArm->RemoveAttachable (heldDevice));
13021302 m_pBGArm->SetHandPos (m_Pos + RotateOffset (m_HolsterOffset));
13031303 return true ;
13041304 }
@@ -3151,7 +3151,10 @@ void AHuman::Update()
31513151 }
31523152 }
31533153 // Disengage the prone state as soon as crouch is released.
3154- if (!crouching) { m_ProneState = NOTPRONE; }
3154+ if (!crouching && m_ProneState != NOTPRONE) {
3155+ EquipShieldInBGArm ();
3156+ m_ProneState = NOTPRONE;
3157+ }
31553158 }
31563159
31573160 // //////////////////////////////////
@@ -3303,6 +3306,8 @@ void AHuman::Update()
33033306 if (deviceAsFirearm->FiredOnce ()) {
33043307 m_CanActivateBGItem = true ;
33053308 m_TriggerPulled = true ;
3309+ } else {
3310+ m_CanActivateBGItem = !deviceAsFirearm->CanFire ();
33063311 }
33073312 }
33083313 }
@@ -3399,6 +3404,8 @@ void AHuman::Update()
33993404 if (deviceAsFirearm->FiredOnce ()) {
34003405 m_CanActivateBGItem = false ;
34013406 m_TriggerPulled = true ;
3407+ } else {
3408+ m_CanActivateBGItem = deviceAsFirearm->CanFire ();
34023409 }
34033410 }
34043411 } else {
@@ -3448,27 +3455,31 @@ void AHuman::Update()
34483455 // Item dropping logic
34493456
34503457 if (m_Controller.IsState (WEAPON_DROP) && m_Status != INACTIVE) {
3451- bool anyDropped = false ;
3458+ Arm *dropperArm = nullptr ;
34523459 for (Arm *arm : { m_pFGArm, m_pBGArm }) {
3453- if (!anyDropped && arm && arm->GetHeldDevice ()) {
3460+ if (arm && arm->GetHeldDevice ()) {
34543461 HeldDevice *heldDevice = arm->GetHeldDevice ();
34553462 arm->RemoveAttachable (heldDevice, true , false );
3463+ if (dropperArm) {
3464+ if (heldDevice) {
3465+ dropperArm->SetHeldDevice (heldDevice);
3466+ arm->SetHandPos (dropperArm->GetPos ());
3467+ }
3468+ } else {
3469+ heldDevice->SetPos (arm->GetJointPos () + Vector (arm->GetMaxLength () * GetFlipFactor (), 0 ).RadRotate (adjustedAimAngle));
3470+ Vector tossVec (1 .0F + std::sqrt (std::abs (arm->GetThrowStrength ()) / std::sqrt (std::abs (heldDevice->GetMass ()) + 1 .0F )), RandomNormalNum ());
3471+ heldDevice->SetVel (heldDevice->GetVel () * 0 .5F + tossVec.RadRotate (m_AimAngle).GetXFlipped (m_HFlipped));
3472+ heldDevice->SetAngularVel (heldDevice->GetAngularVel () + m_AngularVel * 0 .5F + 3 .0F * RandomNormalNum ());
34563473
3457- heldDevice->SetPos (arm->GetJointPos () + Vector (arm->GetMaxLength () * GetFlipFactor (), 0 ).RadRotate (adjustedAimAngle));
3458- Vector tossVec (1 .0F + std::sqrt (std::abs (arm->GetThrowStrength ()) / std::sqrt (std::abs (heldDevice->GetMass ()) + 1 .0F )), RandomNormalNum ());
3459- heldDevice->SetVel (heldDevice->GetVel () * 0 .5F + tossVec.RadRotate (m_AimAngle).GetXFlipped (m_HFlipped));
3460- heldDevice->SetAngularVel (heldDevice->GetAngularVel () + m_AngularVel * 0 .5F + 3 .0F * RandomNormalNum ());
3461-
3462- arm->SetHandPos (heldDevice->GetPos ());
3463- if (!m_Inventory.empty ()) {
3464- arm->SetHeldDevice (dynamic_cast <HeldDevice *>(SwapNextInventory ()));
3465- arm->SetHandPos (m_Pos + RotateOffset (m_HolsterOffset));
3474+ arm->SetHandPos (heldDevice->GetPos ());
34663475 }
3467- anyDropped = true ;
3468- break ;
3476+ dropperArm = arm;
3477+ } else if (dropperArm && !m_Inventory.empty ()) {
3478+ dropperArm->SetHeldDevice (dynamic_cast <HeldDevice*>(SwapNextInventory ()));
3479+ dropperArm->SetHandPos (m_Pos + RotateOffset (m_HolsterOffset));
34693480 }
34703481 }
3471- if (!anyDropped && !m_Inventory.empty () && !m_pFGArm) {
3482+ if (!dropperArm && !m_Inventory.empty () && !m_pFGArm) {
34723483 DropAllInventory ();
34733484 if (m_pBGArm) {
34743485 m_pBGArm->SetHandPos (m_Pos + RotateOffset (m_HolsterOffset));
0 commit comments