From 6cf1fc1869a03b5edb7ed0fdeb39a30c8e92aeae Mon Sep 17 00:00:00 2001 From: Rafal Swierczek <34179rs@gmail.com> Date: Sat, 30 Sep 2023 11:58:53 +0100 Subject: [PATCH] Implemented Unequipping Gadgets when Equipping Gun --- .../Gadgets/TestGadgets/RC_ExampleRecon.uasset | 2 +- .../StarterContent/Architecture/Floor_400x400.uasset | 4 ++-- .../StarterContent/Props/MaterialSphere.uasset | 4 ++-- .../EndlessVendetta/EndlessVendettaCharacter.cpp | 12 ++++++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/EndlessVendetta/Content/Gadgets/TestGadgets/RC_ExampleRecon.uasset b/EndlessVendetta/Content/Gadgets/TestGadgets/RC_ExampleRecon.uasset index 88a1933b..484c5c92 100644 --- a/EndlessVendetta/Content/Gadgets/TestGadgets/RC_ExampleRecon.uasset +++ b/EndlessVendetta/Content/Gadgets/TestGadgets/RC_ExampleRecon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:83a5888b61a03cd032e12e5ed42b2aa5f13ca709b06b50ed9726e7404419cfea +oid sha256:1c4186b567ed68cae389b7f52baee361aec478d019d5b727ecc6132b12c8d02b size 29907 diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..8a892c7b 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:4bad1f067f8be7d35d0fdde8fb883c0f0ec45cedecadc67f58f2f0d9b4e484fb +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset index b2376d1b..56bddfc9 100644 --- a/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset +++ b/EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5a41a71ca352997a9dba7abac1a00868a31a8942a621cb7d614a00c0d6311de -size 47710 +oid sha256:3a8777c01491888bba9f40eda9d2bed76a611f0e80f75917501ce69c1a321342 +size 47333 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 53174fdf..1f197632 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -131,6 +131,12 @@ void AEndlessVendettaCharacter::ToggleCombat() //When 1 is pressed it calls EquipPrimary void AEndlessVendettaCharacter::EquipPrimary() { + // Marcel I respect you, like you and what not, please for the love of god don't touch these two guard clauses + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return;///////////////////////// + if (GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return;/////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + //If primary weapon is not there but secondary weapon is it will call equipSecondary. //EquipSecondary checks and sees that secondary is there so it will call to destroy itself //Code goes back and sees primary weapon is not there anymore and spawns it in. @@ -162,6 +168,12 @@ void AEndlessVendettaCharacter::EquipPrimary() void AEndlessVendettaCharacter::EquipSecondary() { + // Marcel I respect you, like you and what not, please for the love of god don't touch these two guard clauses + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return;///////////////////////// + if (GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return;/////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (!IsValid(SecondaryWeapon)) { if (IsValid(PrimaryWeapon)) EquipPrimary();