From 4c30dc74220029c6aea2966cb549c19f94ed3d9b Mon Sep 17 00:00:00 2001 From: MH261677 Date: Tue, 6 Feb 2024 12:01:59 +0000 Subject: [PATCH] Added new socket, Fixed weapon spawning multiple times --- .../Mesh/SK_Mannequin_Arms_Skeleton.uasset | 4 ++-- .../EndlessVendetta/EndlessVendettaCharacter.cpp | 15 +-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/EndlessVendetta/Content/FirstPersonArms/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset b/EndlessVendetta/Content/FirstPersonArms/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset index a1590c6f..f7250337 100644 --- a/EndlessVendetta/Content/FirstPersonArms/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset +++ b/EndlessVendetta/Content/FirstPersonArms/Character/Mesh/SK_Mannequin_Arms_Skeleton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e87ba3269dc65b8d3dd5024eaeb7bd23f9645fdb6626293ecdc212a0d0778b6 -size 22438 +oid sha256:9d6d0e1ad749362b379767709ce7ec2378355400222aff24ee0bc7a9a0602ac4 +size 22653 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index d8b4f99e..4499c4b1 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -372,12 +372,7 @@ void AEndlessVendettaCharacter::EquipPrimary() Cast(GetWorld()->GetAuthGameMode())->SendEvent("DeEquip", "Pri"); return; } - if (bIsWeaponPickedUp) - { - PrimaryWeaponActor = GetWorld()->SpawnActor(PrimaryWeaponClass, spawnParams); - bIsWeaponPickedUp = false; - } - + if (IsValid(SecondaryWeapon)) EquipSecondary(); if (GadgetManager->IsValidReconGadget() && GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return; @@ -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(PrimaryWeaponActor); @@ -426,12 +419,6 @@ void AEndlessVendettaCharacter::EquipSecondary() return; } - if (bIsWeaponPickedUp) - { - PrimaryWeaponActor = GetWorld()->SpawnActor(PrimaryWeaponClass, spawnParams); - bIsWeaponPickedUp = false; - } - if (IsValid(PrimaryWeapon)) EquipPrimary(); if (GadgetManager->IsValidReconGadget() && GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return;