1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-01 22:36:39 +00:00

Don't consider empty effect lists exceptional

This commit is contained in:
Evil Eye 2023-12-09 18:20:10 +01:00
parent 0da620b3f9
commit 41dc409238

View file

@ -1605,7 +1605,9 @@ namespace MWMechanics
effects = &spell->mEffects.mList; effects = &spell->mEffects.mList;
cast.playSpellCastingEffects(spell); cast.playSpellCastingEffects(spell);
} }
if (mCanCast && !effects->empty()) if (!effects->empty())
{
if (mCanCast)
{ {
const ESM::MagicEffect* effect = store.get<ESM::MagicEffect>().find( const ESM::MagicEffect* effect = store.get<ESM::MagicEffect>().find(
effects->back().mEffectID); // use last effect of list for color of VFX_Hands effects->back().mEffectID); // use last effect of list for color of VFX_Hands
@ -1613,18 +1615,21 @@ namespace MWMechanics
const ESM::Static* castStatic const ESM::Static* castStatic
= world->getStore().get<ESM::Static>().find(ESM::RefId::stringRefId("VFX_Hands")); = world->getStore().get<ESM::Static>().find(ESM::RefId::stringRefId("VFX_Hands"));
const VFS::Manager* const vfs = MWBase::Environment::get().getResourceSystem()->getVFS(); const VFS::Manager* const vfs
= MWBase::Environment::get().getResourceSystem()->getVFS();
if (mAnimation->getNode("Bip01 L Hand")) if (mAnimation->getNode("Bip01 L Hand"))
mAnimation->addEffect(Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs), mAnimation->addEffect(
-1, false, "Bip01 L Hand", effect->mParticle); Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs), -1, false,
"Bip01 L Hand", effect->mParticle);
if (mAnimation->getNode("Bip01 R Hand")) if (mAnimation->getNode("Bip01 R Hand"))
mAnimation->addEffect(Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs), mAnimation->addEffect(
-1, false, "Bip01 R Hand", effect->mParticle); Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs), -1, false,
"Bip01 R Hand", effect->mParticle);
} }
// first effect used for casting animation
const ESM::ENAMstruct& firstEffect = effects->at(0); // first effect used for casting animation const ESM::ENAMstruct& firstEffect = effects->front();
std::string startKey; std::string startKey;
std::string stopKey; std::string stopKey;
@ -1657,10 +1662,11 @@ namespace MWMechanics
stopKey = mAttackType + " stop"; stopKey = mAttackType + " stop";
} }
mAnimation->play(mCurrentWeapon, priorityWeapon, MWRender::Animation::BlendMask_All, false, 1, mAnimation->play(mCurrentWeapon, priorityWeapon, MWRender::Animation::BlendMask_All, false,
startKey, stopKey, 0.0f, 0); 1, startKey, stopKey, 0.0f, 0);
mUpperBodyState = UpperBodyState::Casting; mUpperBodyState = UpperBodyState::Casting;
} }
}
else else
{ {
resetIdle = false; resetIdle = false;