Updated EatableItems.cpp

Made it so when the players health is above 100 they cant heal anymore. (Removed healing stacking)
This commit is contained in:
MH261677 2023-02-04 17:56:25 +00:00
parent 5364f92edb
commit 81d926ffb3

View File

@ -18,11 +18,17 @@ void UEatableItems::Use(ATempCharacter* Character)
{ {
if(isHealingItem == true) if(isHealingItem == true)
{ {
Character->Health += 10; if (Character->Health < 100)
UE_LOG(LogTemp, Display, TEXT("Healed")); {
//delete itself Character->Health += 10;
Character->Inventory->RemoveItem(this); UE_LOG(LogTemp, Display, TEXT("Healed"));
//delete itself
Character->Inventory->RemoveItem(this);
}
else if (Character->Health >= 100)
{
UE_LOG(LogTemp, Display, TEXT("Health is full"));
}
} }
if(isDamageBuffItem == true) if(isDamageBuffItem == true)
{ {