Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
14fa4621e3
@ -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)
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
void ReloadTimer();
|
||||
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FString WeaponName;
|
||||
|
Loading…
Reference in New Issue
Block a user