Add extra checking to Expand Crosshair functionality
This commit is contained in:
parent
9ece07b011
commit
c944e5e6f9
|
@ -20,10 +20,12 @@ void UPlayerHUDWidget::ExpandCrosshair()
|
||||||
{
|
{
|
||||||
if (CrosshairFired)
|
if (CrosshairFired)
|
||||||
{
|
{
|
||||||
auto player = Cast<APlayerCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
if (auto player = Cast<APlayerCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0)))
|
||||||
float playbackSpeed = 1.0 / player->GetCurrentWeapon()->GetWeaponProperties()->WeaponCooldown;
|
{
|
||||||
|
float playbackSpeed = 1.0 / player->GetCurrentWeapon()->GetWeaponProperties()->WeaponCooldown;
|
||||||
|
|
||||||
PlayAnimation(CrosshairFired, 0.0f, 1, EUMGSequencePlayMode::Forward, playbackSpeed);
|
PlayAnimation(CrosshairFired, 0.0f, 1, EUMGSequencePlayMode::Forward, playbackSpeed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue