diff --git a/Source/Blaster/Character/BlasterCharacter.cpp b/Source/Blaster/Character/BlasterCharacter.cpp index a07a6f3..654483c 100644 --- a/Source/Blaster/Character/BlasterCharacter.cpp +++ b/Source/Blaster/Character/BlasterCharacter.cpp @@ -84,10 +84,8 @@ void ABlasterCharacter::OnRep_ReplicatedMovement() void ABlasterCharacter::Eliminated() { - if (Combat && Combat->PrimaryWeapon) - { - Combat->PrimaryWeapon->Dropped(); - } + if (Combat) Combat->DropWeapons(); + MulticastEliminated(); GetWorldTimerManager().SetTimer( EliminationTimer, diff --git a/Source/Blaster/Components/CombatComponent.cpp b/Source/Blaster/Components/CombatComponent.cpp index 73c0703..088b0ba 100644 --- a/Source/Blaster/Components/CombatComponent.cpp +++ b/Source/Blaster/Components/CombatComponent.cpp @@ -325,6 +325,12 @@ void UCombatComponent::Reload() } } +void UCombatComponent::DropWeapons() +{ + if (PrimaryWeapon) PrimaryWeapon->Dropped(); + if (SecondaryWeapon) SecondaryWeapon->Dropped(); +} + void UCombatComponent::ServerReload_Implementation() { if (Character == nullptr || PrimaryWeapon == nullptr) return; diff --git a/Source/Blaster/Components/CombatComponent.h b/Source/Blaster/Components/CombatComponent.h index bf55c6d..bc973e0 100644 --- a/Source/Blaster/Components/CombatComponent.h +++ b/Source/Blaster/Components/CombatComponent.h @@ -25,6 +25,7 @@ public: void EquipWeapon(class AWeapon* WeaponToEquip); void SwapWeapons(); void Reload(); + void DropWeapons(); UFUNCTION(BlueprintCallable) void FinishedReloading();