From d0a533bf02f11c3b22e54c87e3b0ca31253c77a7 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sun, 2 Nov 2025 08:20:40 +0300 Subject: [PATCH] Use Hand To Hand Hit 2 sound (#8731) --- apps/openmw/mwmechanics/combat.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 7c0c674986..cd25a4f4ea 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -1,6 +1,8 @@ #include "combat.hpp" +#include + #include #include @@ -504,15 +506,19 @@ namespace MWMechanics } MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager(); + auto& prng = MWBase::Environment::get().getWorld()->getPrng(); if (isWerewolf) { - auto& prng = MWBase::Environment::get().getWorld()->getPrng(); const ESM::Sound* sound = store.get().searchRandom("WolfHit", prng); if (sound) sndMgr->playSound3D(victim, sound->mId, 1.0f, 1.0f); } else if (!healthdmg) - sndMgr->playSound3D(victim, ESM::RefId::stringRefId("Hand To Hand Hit"), 1.0f, 1.0f); + { + static const std::array sounds + = { ESM::RefId::stringRefId("Hand To Hand Hit"), ESM::RefId::stringRefId("Hand To Hand Hit 2") }; + sndMgr->playSound3D(victim, sounds[Misc::Rng::rollDice(sounds.size(), prng)], 1.0f, 1.0f); + } } void applyFatigueLoss(const MWWorld::Ptr& attacker, const MWWorld::Ptr& weapon, float attackStrength)