Implemented Unequipping Gadgets when Equipping Gun

This commit is contained in:
Rafal Swierczek 2023-09-30 11:58:53 +01:00
parent fa8c6f681c
commit 6cf1fc1869
4 changed files with 17 additions and 5 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83a5888b61a03cd032e12e5ed42b2aa5f13ca709b06b50ed9726e7404419cfea
oid sha256:1c4186b567ed68cae389b7f52baee361aec478d019d5b727ecc6132b12c8d02b
size 29907

Binary file not shown.

View File

@ -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();