Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Rafal Swierczek 2023-10-23 11:49:16 +01:00
commit 14fa4621e3
2 changed files with 5 additions and 1 deletions

View File

@ -223,6 +223,7 @@ void AEndlessVendettaCharacter::ToggleCombat()
//When 1 is pressed it calls EquipPrimary
void AEndlessVendettaCharacter::EquipPrimary()
{
if (bIsReloading) return;
if (IsValid(PrimaryWeapon))
{
PrimaryWeapon->Destroy();
@ -249,11 +250,12 @@ void AEndlessVendettaCharacter::EquipPrimary()
//Changing PrimaryWeaponActor to ABaseWeaponClass type instead of actor and storing it into PrimaryWeapon which is a ABaseClass Object
//We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
}
void AEndlessVendettaCharacter::EquipSecondary()
{
if (bIsReloading) return;
if (IsValid(SecondaryWeapon))
{
SecondaryWeapon->Destroy();
@ -277,6 +279,7 @@ void AEndlessVendettaCharacter::EquipSecondary()
AActor* SecondaryWeaponActor = GetWorld()->SpawnActor<AActor>(SecondaryWeaponClass, spawnParams);
SecondaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
GetWorldTimerManager().ClearTimer(SecondaryWeapon->reloadTimerHandle);
}
void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)

View File

@ -54,6 +54,7 @@ public:
// Called every frame
virtual void Tick(float DeltaTime) override;
void ReloadTimer();
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString WeaponName;