Add extra checking to Expand Crosshair functionality
This commit is contained in:
		
							parent
							
								
									9ece07b011
								
							
						
					
					
						commit
						c944e5e6f9
					
				@ -20,11 +20,13 @@ 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);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void UPlayerHUDWidget::ShowHitMarker()
 | 
					void UPlayerHUDWidget::ShowHitMarker()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user