From 71f6341f306f15d830e72ceb5caabf7b60a345f3 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sun, 27 Oct 2024 08:04:24 +0300 Subject: [PATCH] Only play critical hit sound for health damage (#8207) --- CHANGELOG.md | 1 + apps/openmw/mwclass/npc.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc3722f394..ab4a74f468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -198,6 +198,7 @@ Bug #8172: Openmw-cs crashes when viewing `Dantooine, Sea` Bug #8187: Intervention effects should use Chebyshev distance to determine the closest marker Bug #8191: NiRollController does not work for sheath meshes + Bug #8207: Using hand-to-hand while sneaking plays the critical hit sound when the target is not getting hurt Feature #1415: Infinite fall failsafe Feature #2566: Handle NAM9 records for manual cell references Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 6e833854e0..cc4a124ec2 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -671,8 +671,11 @@ namespace MWClass { damage *= store.find("fCombatCriticalStrikeMult")->mValue.getFloat(); MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}"); - MWBase::Environment::get().getSoundManager()->playSound3D( - victim, ESM::RefId::stringRefId("critical damage"), 1.0f, 1.0f); + if (healthdmg) + { + MWBase::Environment::get().getSoundManager()->playSound3D( + victim, ESM::RefId::stringRefId("critical damage"), 1.0f, 1.0f); + } } }