From 424716977bd0076d368eac304aee40b0032df5a2 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Wed, 10 Apr 2019 22:20:56 +0300 Subject: [PATCH] Only play miss sound for player attacks (bug #4969) --- CHANGELOG.md | 1 + apps/openmw/mwclass/creature.cpp | 3 ++- apps/openmw/mwclass/npc.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77d3b9c35..61e6318ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Bug #4947: Player character doesn't use lip animation Bug #4948: Footstep sounds while levitating on ground level Bug #4963: Enchant skill progress is incorrect + Bug #4969: "Miss" sound plays for any actor Feature #2229: Improve pathfinding AI Feature #3442: Default values for fallbacks from ini file Feature #3610: Option to invert X axis diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index f3b367087..305402b80 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -376,7 +376,8 @@ namespace MWClass if (!successful) { // Missed - MWBase::Environment::get().getSoundManager()->playSound3D(ptr, "miss", 1.0f, 1.0f); + if (!attacker.isEmpty() && attacker == MWMechanics::getPlayer()) + MWBase::Environment::get().getSoundManager()->playSound3D(ptr, "miss", 1.0f, 1.0f); return; } diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 037f98954..19ad8c66b 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -710,7 +710,8 @@ namespace MWClass if (!successful) { // Missed - sndMgr->playSound3D(ptr, "miss", 1.0f, 1.0f); + if (!attacker.isEmpty() && attacker == MWMechanics::getPlayer()) + sndMgr->playSound3D(ptr, "miss", 1.0f, 1.0f); return; }