diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index e39ead6..a73fc54 100644 --- a/Content/Levels/Build.umap +++ b/Content/Levels/Build.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f3ad658a110136de560f9961c6d7c2af1335ef98784a425a6297c917c8ea192 +oid sha256:31ca0ab77e13884d871763a5bd4d60f44f94f078470cb5d68eff284fce510ae3 size 3655823 diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index c3f4d17..644df2d 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -271,19 +271,27 @@ void ATempCharacter::UseItem(class UBaseItem* Item) void ATempCharacter::BuyItem(AActor* Item) { - UE_LOG(LogTemp, Display, TEXT("Hit Merchant")); - UBaseItem* ItemArray = Item->FindComponentByClass()->GetItem(0); - if (GoldBalance <= 0) + if (Item == nullptr) { - UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); + UE_LOG(LogTemp, Display, TEXT("Item is null")); + return; } - else if (GoldBalance >= ItemArray->ItemCostPrice) + else { - GoldBalance -= ItemArray->ItemCostPrice; - Inventory->AddItem(ItemArray); - UE_LOG(LogTemp, Display, TEXT("Item Purchased")); + UBaseItem* ItemArray = Item->FindComponentByClass()->GetItem(0); + if (GoldBalance <= 0) + { + UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); + } + else if (GoldBalance >= ItemArray->ItemCostPrice) + { + GoldBalance -= ItemArray->ItemCostPrice; + Inventory->AddItem(ItemArray); + UE_LOG(LogTemp, Display, TEXT("Item Purchased")); + } + UE_LOG(LogTemp, Display, TEXT("BUY ITEM FIRING")); + TraceDistance = 1000; + LineTraceLogic(); } - // UE_LOG(LogTemp, Display, TEXT("BUY ITEM FIRING")); - // TraceDistance = 1000; - // LineTraceLogic(); + }