mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Don't consider empty effect lists exceptional
This commit is contained in:
parent
0da620b3f9
commit
41dc409238
@ -1605,61 +1605,67 @@ namespace MWMechanics
|
|||||||
effects = &spell->mEffects.mList;
|
effects = &spell->mEffects.mList;
|
||||||
cast.playSpellCastingEffects(spell);
|
cast.playSpellCastingEffects(spell);
|
||||||
}
|
}
|
||||||
if (mCanCast && !effects->empty())
|
if (!effects->empty())
|
||||||
{
|
{
|
||||||
const ESM::MagicEffect* effect = store.get<ESM::MagicEffect>().find(
|
|
||||||
effects->back().mEffectID); // use last effect of list for color of VFX_Hands
|
|
||||||
|
|
||||||
const ESM::Static* castStatic
|
|
||||||
= world->getStore().get<ESM::Static>().find(ESM::RefId::stringRefId("VFX_Hands"));
|
|
||||||
|
|
||||||
const VFS::Manager* const vfs = MWBase::Environment::get().getResourceSystem()->getVFS();
|
|
||||||
|
|
||||||
if (mAnimation->getNode("Bip01 L Hand"))
|
|
||||||
mAnimation->addEffect(Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs),
|
|
||||||
-1, false, "Bip01 L Hand", effect->mParticle);
|
|
||||||
|
|
||||||
if (mAnimation->getNode("Bip01 R Hand"))
|
|
||||||
mAnimation->addEffect(Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs),
|
|
||||||
-1, false, "Bip01 R Hand", effect->mParticle);
|
|
||||||
}
|
|
||||||
|
|
||||||
const ESM::ENAMstruct& firstEffect = effects->at(0); // first effect used for casting animation
|
|
||||||
|
|
||||||
std::string startKey;
|
|
||||||
std::string stopKey;
|
|
||||||
if (isRandomAttackAnimation(mCurrentWeapon))
|
|
||||||
{
|
|
||||||
startKey = "start";
|
|
||||||
stopKey = "stop";
|
|
||||||
if (mCanCast)
|
if (mCanCast)
|
||||||
world->castSpell(
|
|
||||||
mPtr, mCastingManualSpell); // No "release" text key to use, so cast immediately
|
|
||||||
mCastingManualSpell = false;
|
|
||||||
mCanCast = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (firstEffect.mRange)
|
|
||||||
{
|
{
|
||||||
case 0:
|
const ESM::MagicEffect* effect = store.get<ESM::MagicEffect>().find(
|
||||||
mAttackType = "self";
|
effects->back().mEffectID); // use last effect of list for color of VFX_Hands
|
||||||
break;
|
|
||||||
case 1:
|
const ESM::Static* castStatic
|
||||||
mAttackType = "touch";
|
= world->getStore().get<ESM::Static>().find(ESM::RefId::stringRefId("VFX_Hands"));
|
||||||
break;
|
|
||||||
case 2:
|
const VFS::Manager* const vfs
|
||||||
mAttackType = "target";
|
= MWBase::Environment::get().getResourceSystem()->getVFS();
|
||||||
break;
|
|
||||||
|
if (mAnimation->getNode("Bip01 L Hand"))
|
||||||
|
mAnimation->addEffect(
|
||||||
|
Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs), -1, false,
|
||||||
|
"Bip01 L Hand", effect->mParticle);
|
||||||
|
|
||||||
|
if (mAnimation->getNode("Bip01 R Hand"))
|
||||||
|
mAnimation->addEffect(
|
||||||
|
Misc::ResourceHelpers::correctMeshPath(castStatic->mModel, vfs), -1, false,
|
||||||
|
"Bip01 R Hand", effect->mParticle);
|
||||||
|
}
|
||||||
|
// first effect used for casting animation
|
||||||
|
const ESM::ENAMstruct& firstEffect = effects->front();
|
||||||
|
|
||||||
|
std::string startKey;
|
||||||
|
std::string stopKey;
|
||||||
|
if (isRandomAttackAnimation(mCurrentWeapon))
|
||||||
|
{
|
||||||
|
startKey = "start";
|
||||||
|
stopKey = "stop";
|
||||||
|
if (mCanCast)
|
||||||
|
world->castSpell(
|
||||||
|
mPtr, mCastingManualSpell); // No "release" text key to use, so cast immediately
|
||||||
|
mCastingManualSpell = false;
|
||||||
|
mCanCast = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (firstEffect.mRange)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
mAttackType = "self";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
mAttackType = "touch";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
mAttackType = "target";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
startKey = mAttackType + " start";
|
||||||
|
stopKey = mAttackType + " stop";
|
||||||
}
|
}
|
||||||
|
|
||||||
startKey = mAttackType + " start";
|
mAnimation->play(mCurrentWeapon, priorityWeapon, MWRender::Animation::BlendMask_All, false,
|
||||||
stopKey = mAttackType + " stop";
|
1, startKey, stopKey, 0.0f, 0);
|
||||||
|
mUpperBodyState = UpperBodyState::Casting;
|
||||||
}
|
}
|
||||||
|
|
||||||
mAnimation->play(mCurrentWeapon, priorityWeapon, MWRender::Animation::BlendMask_All, false, 1,
|
|
||||||
startKey, stopKey, 0.0f, 0);
|
|
||||||
mUpperBodyState = UpperBodyState::Casting;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user