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
|
//When 1 is pressed it calls EquipPrimary
|
||||||
void AEndlessVendettaCharacter::EquipPrimary()
|
void AEndlessVendettaCharacter::EquipPrimary()
|
||||||
{
|
{
|
||||||
|
if (bIsReloading) return;
|
||||||
if (IsValid(PrimaryWeapon))
|
if (IsValid(PrimaryWeapon))
|
||||||
{
|
{
|
||||||
PrimaryWeapon->Destroy();
|
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
|
//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
|
//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);
|
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
||||||
|
GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AEndlessVendettaCharacter::EquipSecondary()
|
void AEndlessVendettaCharacter::EquipSecondary()
|
||||||
{
|
{
|
||||||
|
if (bIsReloading) return;
|
||||||
if (IsValid(SecondaryWeapon))
|
if (IsValid(SecondaryWeapon))
|
||||||
{
|
{
|
||||||
SecondaryWeapon->Destroy();
|
SecondaryWeapon->Destroy();
|
||||||
@ -277,6 +279,7 @@ void AEndlessVendettaCharacter::EquipSecondary()
|
|||||||
AActor* SecondaryWeaponActor = GetWorld()->SpawnActor<AActor>(SecondaryWeaponClass, spawnParams);
|
AActor* SecondaryWeaponActor = GetWorld()->SpawnActor<AActor>(SecondaryWeaponClass, spawnParams);
|
||||||
SecondaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
SecondaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
||||||
SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
|
SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
|
||||||
|
GetWorldTimerManager().ClearTimer(SecondaryWeapon->reloadTimerHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
|
void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
|
||||||
|
@ -55,6 +55,7 @@ public:
|
|||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
void ReloadTimer();
|
void ReloadTimer();
|
||||||
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
FString WeaponName;
|
FString WeaponName;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user