From 36daaaed16c3f6e6685f996dbb6a408c6b49325e Mon Sep 17 00:00:00 2001 From: PHILIP WHITE Date: Fri, 20 Oct 2023 23:10:10 +0100 Subject: [PATCH] Bugfix TTuple Error Cannot be Macroed --- .../EndlessVendetta/Inventory/InventoryComponent.cpp | 5 +++-- .../Source/EndlessVendetta/Inventory/InventoryComponent.h | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.cpp b/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.cpp index 260d4637..5378ddcb 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.cpp @@ -36,6 +36,7 @@ void UInventoryComponent::TickComponent(float DeltaTime, ELevelTick TickType, FA bool UInventoryComponent::AddItem(UBaseItem* Item) { + return false; } void UInventoryComponent::LineTraceForItemCheck() @@ -76,8 +77,8 @@ FInventoryTile UInventoryComponent::IndexToTile(const int Index) const TTuple UInventoryComponent::GetItemAtIndex(const int Index) { - if (!InventoryItems.IsValidIndex(Index)) return std::make_tuple(nullptr, false); - return std::make_tuple(InventoryItems[Index], true); + if (!InventoryItems.IsValidIndex(Index)) return MakeTuple(nullptr, false); + return MakeTuple(InventoryItems[Index], true); } int UInventoryComponent::TileToIndex(const FInventoryTile InventoryTile) const diff --git a/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.h b/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.h index 8aee354c..608455c0 100644 --- a/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.h +++ b/EndlessVendetta/Source/EndlessVendetta/Inventory/InventoryComponent.h @@ -18,11 +18,11 @@ public: // Sets default values for this component's properties UInventoryComponent(); - UPROPERTY(EditDefaultsOnly, BlueprintRead, Category="Inventory") + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Inventory") int Columns = 10; - UPROPERTY(EditDefaultsOnly, BlueprintRead, Category="Inventory") + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Inventory") int Rows = 10; - UPROPERTY(EditDefaultsOnly, BlueprintRead, Category="Inventory") + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Inventory") float MaxPickupDistance = 200.0f; protected: @@ -43,7 +43,7 @@ public: bool IsRoomAvailable(class UBaseItem* Item, const int TopLeftIndex); UFUNCTION(BlueprintCallable, Category="Inventory") FInventoryTile IndexToTile(const int Index) const; - UFUNCTION(BlueprintCallable, Category="Inventory") + //UFUNCTION(BlueprintCallable, Category="Inventory") TTuple GetItemAtIndex(const int Index); UFUNCTION(BlueprintCallable, Category="Inventory") int TileToIndex(const FInventoryTile InventoryTile) const;