modified the AOE randomize item filter

This commit is contained in:
Ji Yoon Rhee 2025-06-09 23:12:32 +09:00
parent 89fb53f538
commit f6bbeb4380

View File

@ -53,7 +53,7 @@ bool AHYShopAOE::RandomizeTradableItemSets(int CurrentHonbaekAmount)
// Filtering match the case.(Item can be bought, ItemValue is less and equal than honbaek amount and over than 0) // Filtering match the case.(Item can be bought, ItemValue is less and equal than honbaek amount and over than 0)
TArray<FInventoryItem*> FilteredItemData = ItemData.FilterByPredicate([CurrentHonbaekAmount](const FInventoryItem* ItemDataRow) TArray<FInventoryItem*> FilteredItemData = ItemData.FilterByPredicate([CurrentHonbaekAmount](const FInventoryItem* ItemDataRow)
{ {
return !ItemDataRow->OnlyDropped && ItemDataRow->ItemValue > 0 && ItemDataRow->ItemValue <= CurrentHonbaekAmount; return !ItemDataRow->OnlyDropped && ItemDataRow->ItemValue > 0 && ItemDataRow->ItemValue <= CurrentHonbaekAmount && ItemDataRow->CanBeBought;
}); });
int maxLoopNum = FMath::Min(5, FilteredItemData.Num()); int maxLoopNum = FMath::Min(5, FilteredItemData.Num());