From 65ee420ab93422e0b3ee4ce87279cf51b770cce9 Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Sun, 14 Jul 2019 23:42:42 +0300 Subject: [PATCH 1/3] Only play on-strike failure sound on the player (bug #5092) --- apps/openmw/mwmechanics/spellcasting.cpp | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 2de6f75fa..2c178a40e 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -838,21 +838,24 @@ namespace MWMechanics if (item.getCellRef().getEnchantmentCharge() < castCost) { if (mCaster == getPlayer()) + { MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicInsufficientCharge}"); - // Failure sound - int school = 0; - if (!enchantment->mEffects.mList.empty()) - { - short effectId = enchantment->mEffects.mList.front().mEffectID; - const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get().find(effectId); - school = magicEffect->mData.mSchool; + // Failure sound + int school = 0; + if (!enchantment->mEffects.mList.empty()) + { + short effectId = enchantment->mEffects.mList.front().mEffectID; + const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get().find(effectId); + school = magicEffect->mData.mSchool; + } + + static const std::string schools[] = { + "alteration", "conjuration", "destruction", "illusion", "mysticism", "restoration" + }; + MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); + sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f); } - static const std::string schools[] = { - "alteration", "conjuration", "destruction", "illusion", "mysticism", "restoration" - }; - MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); - sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f); return false; } // Reduce charge From 29ebfe709ebc459234107e5dda8401faaf46a4c9 Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Sun, 14 Jul 2019 23:56:38 +0300 Subject: [PATCH 2/3] Play 'Hand To Hand Hit' only for fatigue damage (bug #5093) --- apps/openmw/mwmechanics/combat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 68c94b9ee..b39d769b2 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -441,7 +441,7 @@ namespace MWMechanics if(sound) sndMgr->playSound3D(victim, sound->mId, 1.0f, 1.0f); } - else + else if (!healthdmg) sndMgr->playSound3D(victim, "Hand To Hand Hit", 1.0f, 1.0f); } From 6cad48b1ad72ecafb0fe82a53e097049fa10efb0 Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Sun, 14 Jul 2019 23:57:52 +0300 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ba7febd1..dc5b0e4de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -110,6 +110,8 @@ Bug #5074: Paralyzed actors greet the player Bug #5075: Enchanting cast style can be changed if there's no object Bug #5082: Scrolling with controller in GUI mode is broken + Bug #5092: NPCs with enchanted weapons play sound when out of charges + Bug #5093: Hand to hand sound plays on knocked out enemies Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls