1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:53:52 +00:00

Merge pull request #2451 from Capostrophic/sounds

Fix combat sound inconsistencies (bugs #5092, #5093)
This commit is contained in:
Andrei Kortunov 2019-07-19 08:03:33 +04:00 committed by GitHub
commit 69277b52d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 13 deletions

View file

@ -112,6 +112,8 @@
Bug #5074: Paralyzed actors greet the player Bug #5074: Paralyzed actors greet the player
Bug #5075: Enchanting cast style can be changed if there's no object Bug #5075: Enchanting cast style can be changed if there's no object
Bug #5082: Scrolling with controller in GUI mode is broken 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 #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI
Feature #3025: Analogue gamepad movement controls Feature #3025: Analogue gamepad movement controls

View file

@ -441,7 +441,7 @@ namespace MWMechanics
if(sound) if(sound)
sndMgr->playSound3D(victim, sound->mId, 1.0f, 1.0f); sndMgr->playSound3D(victim, sound->mId, 1.0f, 1.0f);
} }
else else if (!healthdmg)
sndMgr->playSound3D(victim, "Hand To Hand Hit", 1.0f, 1.0f); sndMgr->playSound3D(victim, "Hand To Hand Hit", 1.0f, 1.0f);
} }

View file

@ -838,6 +838,7 @@ namespace MWMechanics
if (item.getCellRef().getEnchantmentCharge() < castCost) if (item.getCellRef().getEnchantmentCharge() < castCost)
{ {
if (mCaster == getPlayer()) if (mCaster == getPlayer())
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicInsufficientCharge}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicInsufficientCharge}");
// Failure sound // Failure sound
@ -848,11 +849,13 @@ namespace MWMechanics
const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectId); const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectId);
school = magicEffect->mData.mSchool; school = magicEffect->mData.mSchool;
} }
static const std::string schools[] = { static const std::string schools[] = {
"alteration", "conjuration", "destruction", "illusion", "mysticism", "restoration" "alteration", "conjuration", "destruction", "illusion", "mysticism", "restoration"
}; };
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f); sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
}
return false; return false;
} }
// Reduce charge // Reduce charge