From fc25c8adf0ecea486f809e6c3f302d938510d886 Mon Sep 17 00:00:00 2001 From: MarcelHara Date: Tue, 9 May 2023 16:22:35 +0100 Subject: [PATCH] Updated TempCharacter to start fixing bugs --- .../Items/ItemsInWorld/BP_Azos.uasset | 4 ++-- .../Items/ItemsInWorld/BP_Eis.uasset | 4 ++-- .../Items/ItemsInWorld/BP_Iroquoid.uasset | 4 ++-- .../Items/ItemsInWorld/BP_Probertium.uasset | 4 ++-- .../PlayerTemp/TempCharacter.cpp | 23 +++++++++++++------ 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/Content/Blueprints/Items/ItemsInWorld/BP_Azos.uasset b/Content/Blueprints/Items/ItemsInWorld/BP_Azos.uasset index 501da09..143e77a 100644 --- a/Content/Blueprints/Items/ItemsInWorld/BP_Azos.uasset +++ b/Content/Blueprints/Items/ItemsInWorld/BP_Azos.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:218c1e1abb52d79ee0a855d573bc7b8d2bb203ff3503c643f8500c9b09773107 -size 29309 +oid sha256:9e4a5a27055688ae5dd4677261d21d5fca582bf3ab9e51db438164de8a48aebb +size 29367 diff --git a/Content/Blueprints/Items/ItemsInWorld/BP_Eis.uasset b/Content/Blueprints/Items/ItemsInWorld/BP_Eis.uasset index 2c22049..69e0b03 100644 --- a/Content/Blueprints/Items/ItemsInWorld/BP_Eis.uasset +++ b/Content/Blueprints/Items/ItemsInWorld/BP_Eis.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40b1b3aba3e44f2ae79359b14e31f68e79ca1dd18de2737374f36c4c6d9711b4 -size 31932 +oid sha256:abd42ce36414c2273ef4f2a220b0923a01c019c6d6d3c725c3750fb2ed82a9b7 +size 30253 diff --git a/Content/Blueprints/Items/ItemsInWorld/BP_Iroquoid.uasset b/Content/Blueprints/Items/ItemsInWorld/BP_Iroquoid.uasset index 69548c5..4e91987 100644 --- a/Content/Blueprints/Items/ItemsInWorld/BP_Iroquoid.uasset +++ b/Content/Blueprints/Items/ItemsInWorld/BP_Iroquoid.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc570407694c572b3cce6254dfc498fa53ef3c61638344f473b138603903f319 -size 29398 +oid sha256:22c938e0f7c03dff887dcfdeb66b9b17a6abf0623f7ae0b95e2a10779b8240d2 +size 29472 diff --git a/Content/Blueprints/Items/ItemsInWorld/BP_Probertium.uasset b/Content/Blueprints/Items/ItemsInWorld/BP_Probertium.uasset index fae48da..20b25f2 100644 --- a/Content/Blueprints/Items/ItemsInWorld/BP_Probertium.uasset +++ b/Content/Blueprints/Items/ItemsInWorld/BP_Probertium.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d99da4ac4717b672848646555b5a0b0cd6f3f9899d4ab4a0ad3dee239821c48 -size 29292 +oid sha256:89ac9fd992de872aa3c69bd388f455780a3c6e59ad3c64bcc4a35912eabc86a8 +size 29350 diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index 644df2d..4c0cba6 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -142,18 +142,31 @@ void ATempCharacter::LineTraceLogic() FVector End = Start + GlobalTrace * ThisCamera->GetForwardVector(); FCollisionQueryParams TraceParams; TraceParams.AddIgnoredActor(this); - bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Pawn, TraceParams); if (bHit) { - //we store the GetItem function from InventoryComponent into ItemArray variable - if (OutHit.GetActor() == nullptr) { return; } if (OutHit.GetActor()->FindComponentByClass()) { + if(OutHit.GetActor()->ActorHasTag(TEXT("Probertium"))) + { + OutHit.GetActor()->Destroy(); + } + else if(OutHit.GetActor()->ActorHasTag(TEXT("Iroquid"))) + { + OutHit.GetActor()->Destroy(); + } + else if (OutHit.GetActor()->ActorHasTag(TEXT("Azos"))) + { + OutHit.GetActor()->Destroy(); + } + else if (OutHit.GetActor()->ActorHasTag(TEXT("Eis"))) + { + OutHit.GetActor()->Destroy(); + } UE_LOG(LogTemp, Display, TEXT("Hit Merchant")); auto ItemArray = OutHit.GetActor()->FindComponentByClass()->GetItem(0); if (GoldBalance >= ItemArray->ItemCostPrice) @@ -166,10 +179,6 @@ void ATempCharacter::LineTraceLogic() { UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); } - if (OutHit.GetActor()->ActorHasTag(Ammo)) - { - OutHit.GetActor()->Destroy(); - } } // if the actor hit has the interaction component/script then it will activate the code