Added new socket, Fixed weapon spawning multiple times

This commit is contained in:
MH261677 2024-02-06 12:01:59 +00:00
parent 64f17d7835
commit 4c30dc7422
2 changed files with 3 additions and 16 deletions

View File

@ -372,11 +372,6 @@ void AEndlessVendettaCharacter::EquipPrimary()
Cast<AEndlessVendettaGameMode>(GetWorld()->GetAuthGameMode())->SendEvent("DeEquip", "Pri");
return;
}
if (bIsWeaponPickedUp)
{
PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
bIsWeaponPickedUp = false;
}
if (IsValid(SecondaryWeapon)) EquipSecondary();
@ -394,8 +389,6 @@ void AEndlessVendettaCharacter::EquipPrimary()
PrimaryWeapon->SetActorHiddenInGame(false);
bIsPrimaryWeaponCreated = true;
}
//UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
GLog->Log("Secondary Weapon Equipped");
}
PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
@ -426,12 +419,6 @@ void AEndlessVendettaCharacter::EquipSecondary()
return;
}
if (bIsWeaponPickedUp)
{
PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
bIsWeaponPickedUp = false;
}
if (IsValid(PrimaryWeapon)) EquipPrimary();
if (GadgetManager->IsValidReconGadget() && GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return;