1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 03:45:32 +00:00

Only play on-strike failure sound on the player (bug #5092)

This commit is contained in:
Alexei Dobrohotov 2019-07-14 23:42:42 +03:00 committed by GitHub
parent e4c596adf8
commit 65ee420ab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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