Bugfix Side Bounties Stayed in Pause Menu after Completion

This commit is contained in:
Rafal Swierczek 2024-02-22 16:18:08 +00:00
parent b6fb2da0ca
commit c166aa1cdb
2 changed files with 8 additions and 7 deletions

View File

@ -8,9 +8,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="dfa3053d-1d51-4dad-9270-4c17e086f627" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/Content/PauseMenu/Tabs/BountyTabs/WBP_BountiesTab.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/PauseMenu/Tabs/BountyTabs/WBP_BountiesTab.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -142,7 +140,7 @@
<workItem from="1708180486567" duration="2641000" />
<workItem from="1708269543495" duration="2914000" />
<workItem from="1708434176965" duration="6053000" />
<workItem from="1708607826264" duration="2343000" />
<workItem from="1708607826264" duration="3320000" />
</task>
<servers />
</component>

View File

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