Skip to content

Commit 00c42eb

Browse files
committed
use correct index for core rich presence check
1 parent ea0416b commit 00c42eb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ui/viewmodels/AssetListViewModel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ void AssetListViewModel::DoUpdateButtons()
632632
bool bHasUnofficial = false;
633633
bool bHasCore = false;
634634
bool bHasLocal = false;
635-
bool bHasRichPresenceSelection = false;
635+
gsl::index nRichPresenceSelectionIndex = -1;
636636
bool bHasNonRichPresenceSelection = false;
637637

638638
const bool bGameLoaded = (GetGameId() != 0);
@@ -711,7 +711,7 @@ void AssetListViewModel::DoUpdateButtons()
711711
switch (pItem->GetType())
712712
{
713713
case ra::data::models::AssetType::RichPresence:
714-
bHasRichPresenceSelection = true;
714+
nRichPresenceSelectionIndex = i;
715715
break;
716716
default:
717717
bHasNonRichPresenceSelection = true;
@@ -739,7 +739,7 @@ void AssetListViewModel::DoUpdateButtons()
739739
}
740740
}
741741

742-
if (bHasRichPresenceSelection)
742+
if (nRichPresenceSelectionIndex != -1)
743743
{
744744
SetValue(CanCreateProperty, true);
745745
SetValue(CanCloneProperty, false);
@@ -758,7 +758,7 @@ void AssetListViewModel::DoUpdateButtons()
758758
std::vector<AssetSummaryViewModel> vSelectedAssets;
759759
SetValue(CanRevertProperty,
760760
(!bHasNonRichPresenceSelection &&
761-
m_vFilteredAssets.GetItemAt(0)->GetCategory() == ra::data::models::AssetCategory::Core));
761+
m_vFilteredAssets.GetItemAt(nRichPresenceSelectionIndex)->GetCategory() == ra::data::models::AssetCategory::Core));
762762

763763
return;
764764
}

tests/Exports_Tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ TEST_CLASS(Exports_Tests)
954954
private:
955955
void AssertMenuItem(const RA_MenuItem* pItem, LPARAM nId, const wchar_t* sLabel, bool bChecked = false)
956956
{
957-
Assert::AreEqual(nId, pItem->nID);
957+
Assert::AreEqual((int)nId, (int)pItem->nID);
958958

959959
if (sLabel == nullptr)
960960
Assert::IsNull(pItem->sLabel);

0 commit comments

Comments
 (0)