forked from teamnwah/openmw-tes3coop
Merge pull request #1143 from kurnevsky/crash-fix
Crash fix when item is disabled before it casts spell.
This commit is contained in:
commit
250c862ded
1 changed files with 2 additions and 2 deletions
|
@ -913,7 +913,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
||||||
|
|
||||||
if (mCaster.getClass().isActor()) // TODO: Non-actors should also create a spell cast vfx
|
if (animation && mCaster.getClass().isActor()) // TODO: Non-actors should also create a spell cast vfx even if they are disabled (animation == NULL)
|
||||||
{
|
{
|
||||||
const ESM::Static* castStatic;
|
const ESM::Static* castStatic;
|
||||||
|
|
||||||
|
@ -927,7 +927,7 @@ namespace MWMechanics
|
||||||
animation->addEffect("meshes\\" + castStatic->mModel, effect->mIndex, false, "", texture);
|
animation->addEffect("meshes\\" + castStatic->mModel, effect->mIndex, false, "", texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mCaster.getClass().isActor())
|
if (animation && !mCaster.getClass().isActor())
|
||||||
animation->addSpellCastGlow(effect);
|
animation->addSpellCastGlow(effect);
|
||||||
|
|
||||||
static const std::string schools[] = {
|
static const std::string schools[] = {
|
||||||
|
|
Loading…
Reference in a new issue