From c166aa1cdb8483d1288f2b9b70a83ec259381bea Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Thu, 22 Feb 2024 16:18:08 +0000 Subject: [PATCH] Bugfix Side Bounties Stayed in Pause Menu after Completion --- .../.idea/.idea.EndlessVendetta/.idea/workspace.xml | 4 +--- .../Characters/BountyHunterCharacter.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml index 6d55a51c..609593f7 100644 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml +++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml @@ -8,9 +8,7 @@ - - diff --git a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp index e9cf2b52..44257234 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp @@ -53,12 +53,15 @@ void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI) void ABountyHunterCharacter::CompletedASideBounty(int CompletedSideBountiesUID) { - for (auto SBStruct : SideBountyStructs) + for (int i = 0; i < SideBountyStructs.Num(); i++) { - if (SBStruct.SideBountyUID != CompletedSideBountiesUID) continue; - EarnMoney(SBStruct.MoneyEarnedForCompletion); - EarnFavours(SBStruct.FavoursEarnedForCompletion); + if (SideBountyStructs[i].SideBountyUID != CompletedSideBountiesUID) continue; + EarnMoney(SideBountyStructs[i].MoneyEarnedForCompletion); + EarnFavours(SideBountyStructs[i].FavoursEarnedForCompletion); if (IsValid(PauseMenu)) PauseMenu->UpdatePlayerStatistics(Money, Favours); + + SideBountyStructs.RemoveAt(i); + UpdateBountyTabInfo(); } }