From 247ab29a6101bd2428a1b883adb973c71312a85f Mon Sep 17 00:00:00 2001 From: MH261677 Date: Fri, 12 Jan 2024 15:38:09 +0000 Subject: [PATCH] Fixed player crashing if no starter weapons --- .../Source/EndlessVendetta/EndlessVendettaCharacter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 438d89e8..1393ee9b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -313,6 +313,7 @@ void AEndlessVendettaCharacter::ToggleCombat() //When 1 is pressed it calls EquipPrimary void AEndlessVendettaCharacter::EquipPrimary() { + if (!IsValid(PrimaryWeaponClass)) return; FActorSpawnParameters spawnParams; spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); @@ -364,6 +365,7 @@ void AEndlessVendettaCharacter::EquipPrimary() void AEndlessVendettaCharacter::EquipSecondary() { + if (!IsValid(SecondaryWeaponClass)) return; FActorSpawnParameters spawnParams; spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);