118 - Auto Reload
This commit is contained in:
parent
bfe46a2e91
commit
6960a94be5
|
@ -213,6 +213,10 @@ void UCombatComponent::FireTimerFinished()
|
||||||
{
|
{
|
||||||
Fire();
|
Fire();
|
||||||
}
|
}
|
||||||
|
if (EquippedWeapon->IsEmpty())
|
||||||
|
{
|
||||||
|
Reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UCombatComponent::CanFire()
|
bool UCombatComponent::CanFire()
|
||||||
|
@ -330,6 +334,11 @@ void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
|
||||||
{
|
{
|
||||||
UGameplayStatics::PlaySoundAtLocation(this, EquippedWeapon->EquipSound, Character->GetActorLocation());
|
UGameplayStatics::PlaySoundAtLocation(this, EquippedWeapon->EquipSound, Character->GetActorLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (EquippedWeapon->IsEmpty())
|
||||||
|
{
|
||||||
|
Reload();
|
||||||
|
}
|
||||||
Character->GetCharacterMovement()->bOrientRotationToMovement = false;
|
Character->GetCharacterMovement()->bOrientRotationToMovement = false;
|
||||||
Character->bUseControllerRotationYaw = true;
|
Character->bUseControllerRotationYaw = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue