Updated Merchant
Fixed crash error and merchant dialouge box pops up now, Started working on item stacking
This commit is contained in:
parent
320a74d4bb
commit
c107c9a490
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/MerchantPrototype.umap
(Stored with Git LFS)
BIN
Content/Levels/MerchantPrototype.umap
(Stored with Git LFS)
Binary file not shown.
@ -24,7 +24,7 @@ public:
|
|||||||
// Called every frame
|
// Called every frame
|
||||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||||
|
|
||||||
UPROPERTY(EditDefaults)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
bool bInteractable = false;
|
bool bInteractable = false;
|
||||||
|
|
||||||
UFUNCTION(Blueprintcallable)
|
UFUNCTION(Blueprintcallable)
|
||||||
|
@ -77,13 +77,14 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
if (bHit)
|
if (bHit)
|
||||||
{
|
{
|
||||||
//we store the GetItem function from InventoryComponent into ItemArray variable
|
//we store the GetItem function from InventoryComponent into ItemArray variable
|
||||||
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
|
||||||
if(OutHit.GetActor() == nullptr)
|
if(OutHit.GetActor() == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
|
if(OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
|
||||||
{
|
{
|
||||||
|
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
||||||
if(GoldBalance >= ItemArray->ItemCostPrice)
|
if(GoldBalance >= ItemArray->ItemCostPrice)
|
||||||
{
|
{
|
||||||
GoldBalance -= ItemArray->ItemCostPrice;
|
GoldBalance -= ItemArray->ItemCostPrice;
|
||||||
|
Loading…
Reference in New Issue
Block a user