Updated EatableItems to fix Ammo Consuming
Fixed ammo consuming crashing the client
This commit is contained in:
parent
618a9509ca
commit
e9af8b713f
@ -14,3 +14,4 @@ void UBaseItem::Use(ATempCharacter* Character)
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,4 +72,5 @@ public:
|
|||||||
//This is the same as the use item class but its in BP instead
|
//This is the same as the use item class but its in BP instead
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
void OnUse(class ATempCharacter* Character);
|
void OnUse(class ATempCharacter* Character);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -39,6 +39,7 @@ void UEatableItems::Use(ATempCharacter* Character)
|
|||||||
|
|
||||||
if (isAmmoItemType)
|
if (isAmmoItemType)
|
||||||
{
|
{
|
||||||
|
TurnBaseCombat = GetWorld()->GetGameState<ATurnBaseCombatV2>();
|
||||||
if (TurnBaseCombat->IronResource > 10)
|
if (TurnBaseCombat->IronResource > 10)
|
||||||
{
|
{
|
||||||
TurnBaseCombat->IronResource += 5;
|
TurnBaseCombat->IronResource += 5;
|
||||||
|
Loading…
Reference in New Issue
Block a user