Removed Unmatching code in PrimaryWeapon switcher
This commit is contained in:
parent
e44395a58f
commit
f8aee1c58a
@ -382,7 +382,6 @@ void AEndlessVendettaCharacter::EquipPrimary()
|
||||
if (GadgetManager->IsValidReconGadget() && GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return;
|
||||
if (GadgetManager->IsValidCombatGadget() && GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return;
|
||||
|
||||
|
||||
if (!IsValid(PrimaryWeapon))
|
||||
{
|
||||
bHasRifle = true;
|
||||
@ -394,30 +393,13 @@ void AEndlessVendettaCharacter::EquipPrimary()
|
||||
PrimaryWeapon->SetActorHiddenInGame(false);
|
||||
bIsPrimaryWeaponCreated = true;
|
||||
}
|
||||
//UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
|
||||
GLog->Log("Primary Weapon Equipped");
|
||||
//UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
|
||||
GLog->Log("Secondary Weapon Equipped");
|
||||
}
|
||||
|
||||
if (!IsValid(PrimaryWeaponActor)) return;
|
||||
Cast<AEndlessVendettaGameMode>(GetWorld()->GetAuthGameMode())->SendEvent("Equip", "Pri");
|
||||
PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
||||
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
||||
PrimaryWeapon->SetActorHiddenInGame(false);
|
||||
GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
|
||||
|
||||
// bHasRifle = true;
|
||||
// // if(!bIsPrimaryWeaponCreated)
|
||||
// // {
|
||||
// // //Creating a new actor object called PrimaryWeapon that is based off primaryweaponClass
|
||||
// // //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
|
||||
// // PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
|
||||
// // PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
||||
// // PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
||||
// // PrimaryWeapon->SetActorHiddenInGame(false);
|
||||
// // bIsPrimaryWeaponCreated = true;
|
||||
// // }
|
||||
|
||||
}
|
||||
|
||||
void AEndlessVendettaCharacter::EquipSecondary()
|
||||
|
Loading…
Reference in New Issue
Block a user