From 9d2d3c01872de0ce7c6dcd7f2e4d9ffad4ea8fdd Mon Sep 17 00:00:00 2001 From: Louis Hobbs Date: Thu, 16 Mar 2023 23:50:15 +0000 Subject: [PATCH] Fix `PlayFireSoundAtLocation` bugs --- Source/Nakatomi/PlayerCharacter.cpp | 2 +- Source/Nakatomi/Weapon.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index f2404a4..98a2057 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -310,7 +310,7 @@ void APlayerCharacter::OnFire() CurrentWeapon->DecrementAmmoCount(1); - CurrentWeapon->PlayFireSoundAtLocation(GetActorLocation()); + CurrentWeapon->PlayFireSoundAtLocation(this->GetTransform().GetLocation()); // TODO: Play some animation here diff --git a/Source/Nakatomi/Weapon.cpp b/Source/Nakatomi/Weapon.cpp index dcfb7d6..f21262e 100644 --- a/Source/Nakatomi/Weapon.cpp +++ b/Source/Nakatomi/Weapon.cpp @@ -71,7 +71,7 @@ void AWeapon::SetFireSound(USoundBase* USoundBase) void AWeapon::PlayFireSoundAtLocation(FVector location) { - if (!FireSound) + if (FireSound) { UGameplayStatics::PlaySoundAtLocation(this, FireSound, location); }