118 - Auto Reload

This commit is contained in:
Kingsmedia 2022-05-10 00:45:30 +02:00
parent bfe46a2e91
commit 6960a94be5
1 changed files with 9 additions and 0 deletions

View File

@ -213,6 +213,10 @@ void UCombatComponent::FireTimerFinished()
{
Fire();
}
if (EquippedWeapon->IsEmpty())
{
Reload();
}
}
bool UCombatComponent::CanFire()
@ -330,6 +334,11 @@ void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
{
UGameplayStatics::PlaySoundAtLocation(this, EquippedWeapon->EquipSound, Character->GetActorLocation());
}
if (EquippedWeapon->IsEmpty())
{
Reload();
}
Character->GetCharacterMovement()->bOrientRotationToMovement = false;
Character->bUseControllerRotationYaw = true;
}