Updated EatableItems to fix Ammo Consuming

Fixed ammo consuming crashing the client
This commit is contained in:
MARCEL HARA 2023-02-20 14:49:05 +00:00
parent 618a9509ca
commit e9af8b713f
3 changed files with 3 additions and 0 deletions

View File

@ -14,3 +14,4 @@ void UBaseItem::Use(ATempCharacter* Character)
{
}

View File

@ -72,4 +72,5 @@ public:
//This is the same as the use item class but its in BP instead
UFUNCTION(BlueprintImplementableEvent)
void OnUse(class ATempCharacter* Character);
};

View File

@ -39,6 +39,7 @@ void UEatableItems::Use(ATempCharacter* Character)
if (isAmmoItemType)
{
TurnBaseCombat = GetWorld()->GetGameState<ATurnBaseCombatV2>();
if (TurnBaseCombat->IronResource > 10)
{
TurnBaseCombat->IronResource += 5;