Updated TempCharacter to stop crashes
This commit is contained in:
parent
0632a1770b
commit
b3c83f161f
BIN
Content/Levels/Build.umap
(Stored with Git LFS)
BIN
Content/Levels/Build.umap
(Stored with Git LFS)
Binary file not shown.
@ -271,7 +271,13 @@ void ATempCharacter::UseItem(class UBaseItem* Item)
|
|||||||
|
|
||||||
void ATempCharacter::BuyItem(AActor* Item)
|
void ATempCharacter::BuyItem(AActor* Item)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Display, TEXT("Hit Merchant"));
|
if (Item == nullptr)
|
||||||
|
{
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("Item is null"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
UBaseItem* ItemArray = Item->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
UBaseItem* ItemArray = Item->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
||||||
if (GoldBalance <= 0)
|
if (GoldBalance <= 0)
|
||||||
{
|
{
|
||||||
@ -283,7 +289,9 @@ void ATempCharacter::BuyItem(AActor* Item)
|
|||||||
Inventory->AddItem(ItemArray);
|
Inventory->AddItem(ItemArray);
|
||||||
UE_LOG(LogTemp, Display, TEXT("Item Purchased"));
|
UE_LOG(LogTemp, Display, TEXT("Item Purchased"));
|
||||||
}
|
}
|
||||||
// UE_LOG(LogTemp, Display, TEXT("BUY ITEM FIRING"));
|
UE_LOG(LogTemp, Display, TEXT("BUY ITEM FIRING"));
|
||||||
// TraceDistance = 1000;
|
TraceDistance = 1000;
|
||||||
// LineTraceLogic();
|
LineTraceLogic();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user