the player can pick up consumable items and use items for different effects; needs optimization in player character base BP class
This commit is contained in:
@ -39,6 +39,18 @@ bool AHYPlayerCharacController::AddItemToInventoryByID(FName ID)
|
||||
return false;
|
||||
}
|
||||
|
||||
void AHYPlayerCharacController::CraftItem(FInventoryItem ItemA, FInventoryItem ItemB)
|
||||
{
|
||||
for (auto Pair : ItemB.CraftCombinations) {
|
||||
if (Pair.ComponentID == ItemA.ItemID) {
|
||||
if (Pair.bDestroyItemA) Inventory.RemoveSingle(ItemA);
|
||||
if (Pair.bDestroyItemB) Inventory.RemoveSingle(ItemB);
|
||||
AddItemToInventoryByID(Pair.ProductID);
|
||||
ReloadCraftUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AHYPlayerCharacController::Interact()
|
||||
{
|
||||
if (CurrentInteractable) CurrentInteractable->Interact(this);
|
||||
|
Reference in New Issue
Block a user