diff --git a/Content/Assets/Animations/Reload_Rifle_Hip_Fixed.uasset b/Content/Assets/Animations/Reload_Rifle_Hip_Fixed.uasset index 1559403..4ee636a 100644 Binary files a/Content/Assets/Animations/Reload_Rifle_Hip_Fixed.uasset and b/Content/Assets/Animations/Reload_Rifle_Hip_Fixed.uasset differ diff --git a/Content/Blueprints/Character/BP_BlasterCharacter.uasset b/Content/Blueprints/Character/BP_BlasterCharacter.uasset index 66903ab..38e419d 100644 Binary files a/Content/Blueprints/Character/BP_BlasterCharacter.uasset and b/Content/Blueprints/Character/BP_BlasterCharacter.uasset differ diff --git a/Source/Blaster/Components/CombatComponent.cpp b/Source/Blaster/Components/CombatComponent.cpp index b971afa..545cb07 100644 --- a/Source/Blaster/Components/CombatComponent.cpp +++ b/Source/Blaster/Components/CombatComponent.cpp @@ -219,7 +219,7 @@ bool UCombatComponent::CanFire() { if (EquippedWeapon == nullptr) return false; - return !EquippedWeapon->IsEmpty() || !bCanFire; + return !EquippedWeapon->IsEmpty() && bCanFire && CombatState == ECombatState::ECS_Unoccupied; } void UCombatComponent::OnRep_CarriedAmmo() @@ -244,7 +244,7 @@ void UCombatComponent::ServerFire_Implementation(const FVector_NetQuantize& Trac void UCombatComponent::MulticastFire_Implementation(const FVector_NetQuantize& TraceHitTarget) { if (EquippedWeapon == nullptr) return; - if (Character) + if (Character && CombatState == ECombatState::ECS_Unoccupied) { Character->PlayFireMontage(bAiming); EquippedWeapon->Fire(TraceHitTarget); @@ -345,6 +345,10 @@ void UCombatComponent::FinishedReloading() { CombatState = ECombatState::ECS_Unoccupied;; } + if (bFireButtonPressed) + { + Fire(); + } } void UCombatComponent::ServerReload_Implementation() @@ -362,6 +366,12 @@ void UCombatComponent::OnRep_CombatState() case ECombatState::ECS_Reloading: HandleReload(); break; + case ECombatState::ECS_Unoccupied: + if (bFireButtonPressed) + { + Fire(); + } + break; } }