From f8aee1c58a238458edbe5fa8d8d709cf5ae09ac3 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 6 Feb 2024 11:40:01 +0000 Subject: [PATCH] Removed Unmatching code in PrimaryWeapon switcher --- .../EndlessVendettaCharacter.cpp | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 81ca8170..e61e068f 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -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(GetWorld()->GetAuthGameMode())->SendEvent("Equip", "Pri"); PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint")); PrimaryWeapon = Cast(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(PrimaryWeaponClass, spawnParams); - // // PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint")); - // // PrimaryWeapon = Cast(PrimaryWeaponActor); - // // PrimaryWeapon->SetActorHiddenInGame(false); - // // bIsPrimaryWeaponCreated = true; - // // } - } void AEndlessVendettaCharacter::EquipSecondary()