Skip to content

Commit 3ac4a74

Browse files
committed
Merge branch 'throwingweaponswish' into 'master'
Re-enable swish sound for throwing weapons (#8926) Closes #8926 See merge request OpenMW/openmw!5106
2 parents bbcae3a + f3c1df8 commit 3ac4a74

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

apps/openmw/mwmechanics/character.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,14 @@ namespace MWMechanics
12561256
if (mAttackStrength == -1.f)
12571257
mAttackStrength = std::min(1.f, 0.1f + Misc::Rng::rollClosedProbability(prng));
12581258
ESM::WeaponType::Class weapclass = getWeaponType(mWeaponType)->mWeaponClass;
1259-
if (weapclass != ESM::WeaponType::Ranged && weapclass != ESM::WeaponType::Thrown)
1259+
if (weapclass != ESM::WeaponType::Ranged)
12601260
{
1261-
mAttackSuccess = mPtr.getClass().evaluateHit(mPtr, mAttackVictim, mAttackHitPos);
1262-
if (!mAttackSuccess)
1263-
mAttackStrength = 0.f;
1261+
if (weapclass != ESM::WeaponType::Thrown)
1262+
{
1263+
mAttackSuccess = mPtr.getClass().evaluateHit(mPtr, mAttackVictim, mAttackHitPos);
1264+
if (!mAttackSuccess)
1265+
mAttackStrength = 0.f;
1266+
}
12641267
playSwishSound();
12651268
}
12661269

docs/source/reference/modding/sound-effects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Combat
161161
* - ``miss``
162162
- An attack misses
163163
* - ``weapon swish``
164-
- Melee weapon attack. The sound is modulated based on attack strength.
164+
- Melee or thrown weapon attack. The sound is modulated based on attack strength.
165165

166166

167167
UI

0 commit comments

Comments
 (0)