modified the AOE randomize item filter
This commit is contained in:
parent
89fb53f538
commit
f6bbeb4380
@ -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());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user