From 530c9580ff415a07ef96615d70d86246a1503c58 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Sun, 17 Mar 2024 21:57:01 +0000 Subject: [PATCH] Bugfix Primary Rifles Appear off screen --- .../FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset | 4 ++-- .../Content/FirstPerson/Blueprints/BP_MainCharacter.uasset | 4 ++-- .../BaseWeapons/Pistols/BP_BasePistolWeapon.uasset | 4 ++-- .../StarterContent/Architecture/Floor_400x400.uasset | 4 ++-- .../Blueprints/Blueprint_CeilingLight.uasset | 4 ++-- .../Levels/AITest/0/FP/C223QQ2RGQBAGPV9BEDZ77.uasset | 3 +++ .../Source/EndlessVendetta/EndlessVendettaCharacter.cpp | 4 +++- .../Source/EndlessVendetta/EndlessVendettaCharacter.h | 7 +++++++ .../EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp | 2 +- 9 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 EndlessVendetta/Content/__ExternalActors__/Levels/AITest/0/FP/C223QQ2RGQBAGPV9BEDZ77.uasset diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 869e6257..3f7b61b7 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7e056ebbe800ca78f0f68ed8d48c147cf02dfd4598d35a6dac74362c94d3d25b -size 806750 +oid sha256:28d4447ff98f89b089289d67bcc3b9cf911d9ebe56b4b8e80561340073c7ad19 +size 806638 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset index d5048f8b..c2cc378e 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae3dbf1aff7aa519cf442fc8ea57a843906803d1b370e1faf2f026a957aeae0a -size 1433603 +oid sha256:4b1938c560f8b136dda042d50930f00dff52f5c205974ef5ca4153d0658cfe05 +size 1469253 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset index 77962859..b7673679 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:28f1de341e77981e815b278ddd34d6330e64bcb85333c6067ef3657905657062 -size 235124 +oid sha256:ee780c6e27e5eb4d921395b70077820fc2d0eb3903b9b3cf3cdf87b266d326a0 +size 237532 diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..d814760b 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:765f5e8e8749ed76d2ff8ecd445da829ab700236335db74a90a01217185bf66b +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index 05921a67..c5c3b84e 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2be237878ec514aefc4c807e316db8fe54ff7eb3c1648ecee878838ffe5fa692 -size 43745 +oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 +size 158206 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/AITest/0/FP/C223QQ2RGQBAGPV9BEDZ77.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/AITest/0/FP/C223QQ2RGQBAGPV9BEDZ77.uasset new file mode 100644 index 00000000..db14a0df --- /dev/null +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/AITest/0/FP/C223QQ2RGQBAGPV9BEDZ77.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7da647b9b131236803a64328d94cfa4facd15e4de9b02412c3d1eabcc2711488 +size 6987 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index e3920d92..d10d3074 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -397,6 +397,7 @@ void AEndlessVendettaCharacter::EquipPrimary() if (bIsReloading) return; if (IsValid(PrimaryWeapon)) { + TempUnequippedPrimary(); GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("IsPrimaryWeapon valid check running")); PrimaryWeapon->DetachFromActor(DetatchRules); PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket")); @@ -439,7 +440,7 @@ void AEndlessVendettaCharacter::EquipPrimary() } //For when you already have all your weapons and ur switching with 1 and 2 or when your picking up a weapon with a weapon in hand if (PrimaryWeaponClass != nullptr) - { + { GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Green, TEXT("non ifstatement code running")); PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint")); PrimaryWeapon = Cast(PrimaryWeaponActor); @@ -449,6 +450,7 @@ void AEndlessVendettaCharacter::EquipPrimary() bIsCurrentlyHoldingWeapon = true; bHasRifle = true; SetOverlayState(EOverlayState::AssaultRifle); + TempEquippedPrimary(); } } diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 4978ab3c..8a5aeedf 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -35,6 +35,11 @@ UCLASS(config=Game) class AEndlessVendettaCharacter : public ACharacter { GENERATED_BODY() +public: + UFUNCTION(BlueprintImplementableEvent) + void TempEquippedPrimary(); + UFUNCTION(BlueprintImplementableEvent) + void TempUnequippedPrimary(); protected: /** Pawn mesh: 1st person view (arms; seen only by self) */ @@ -311,7 +316,9 @@ public: void WeaponPickUpSystem(); + UFUNCTION(BlueprintCallable) void EquipPrimary(); + UFUNCTION(BlueprintCallable) void EquipSecondary(); void WeaponSwitcher(AActor* Outhit); diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 22bcc09f..c3266efb 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -47,7 +47,7 @@ void ABaseWeaponClass::BeginPlay() if (!IsValid(endlessVendettaChar)) return; - for (UActorComponent* actorComp : endlessVendettaChar->GetComponentsByTag(UArrowComponent::StaticClass(), FName("GunStart"))) + for (UActorComponent* actorComp : playerInWorld->GetComponentsByTag(UArrowComponent::StaticClass(), FName("GunStart"))) { GunStartArrow = Cast(actorComp); break;