@@ -1298,7 +1298,7 @@ bool AHuman::UnequipBGArm() {
1298
1298
if (m_pBGArm) {
1299
1299
if (HeldDevice *heldDevice = m_pBGArm->GetHeldDevice ()) {
1300
1300
heldDevice->Deactivate ();
1301
- AddToInventoryBack (m_pBGArm->RemoveAttachable (heldDevice));
1301
+ AddToInventoryFront (m_pBGArm->RemoveAttachable (heldDevice));
1302
1302
m_pBGArm->SetHandPos (m_Pos + RotateOffset (m_HolsterOffset));
1303
1303
return true ;
1304
1304
}
@@ -3151,7 +3151,10 @@ void AHuman::Update()
3151
3151
}
3152
3152
}
3153
3153
// 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
+ }
3155
3158
}
3156
3159
3157
3160
// //////////////////////////////////
@@ -3303,6 +3306,8 @@ void AHuman::Update()
3303
3306
if (deviceAsFirearm->FiredOnce ()) {
3304
3307
m_CanActivateBGItem = true ;
3305
3308
m_TriggerPulled = true ;
3309
+ } else {
3310
+ m_CanActivateBGItem = !deviceAsFirearm->CanFire ();
3306
3311
}
3307
3312
}
3308
3313
}
@@ -3399,6 +3404,8 @@ void AHuman::Update()
3399
3404
if (deviceAsFirearm->FiredOnce ()) {
3400
3405
m_CanActivateBGItem = false ;
3401
3406
m_TriggerPulled = true ;
3407
+ } else {
3408
+ m_CanActivateBGItem = deviceAsFirearm->CanFire ();
3402
3409
}
3403
3410
}
3404
3411
} else {
@@ -3448,27 +3455,31 @@ void AHuman::Update()
3448
3455
// Item dropping logic
3449
3456
3450
3457
if (m_Controller.IsState (WEAPON_DROP) && m_Status != INACTIVE) {
3451
- bool anyDropped = false ;
3458
+ Arm *dropperArm = nullptr ;
3452
3459
for (Arm *arm : { m_pFGArm, m_pBGArm }) {
3453
- if (!anyDropped && arm && arm->GetHeldDevice ()) {
3460
+ if (arm && arm->GetHeldDevice ()) {
3454
3461
HeldDevice *heldDevice = arm->GetHeldDevice ();
3455
3462
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 ());
3456
3473
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 ());
3466
3475
}
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));
3469
3480
}
3470
3481
}
3471
- if (!anyDropped && !m_Inventory.empty () && !m_pFGArm) {
3482
+ if (!dropperArm && !m_Inventory.empty () && !m_pFGArm) {
3472
3483
DropAllInventory ();
3473
3484
if (m_pBGArm) {
3474
3485
m_pBGArm->SetHandPos (m_Pos + RotateOffset (m_HolsterOffset));
0 commit comments