Merge branch 'positively_glowing' into 'master'

Detach objects from the active grid when attempting to get their animation

Closes #6105

See merge request OpenMW/openmw!951
dont-compose-content
psi29a 4 years ago
commit 7d8949ec3f

@ -132,12 +132,14 @@ namespace MWClass
MWBase::Environment::get().getWorld()->getMaxActivationDistance())
{
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
if(animation)
{
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
animation->addSpellCastGlow(effect, 1); // 1 second glow to match the time taken for a door opening or closing
animation->addSpellCastGlow(effect, 1); // 1 second glow to match the time taken for a door opening or closing
}
}
const std::string keyId = ptr.getCellRef().getKey();

@ -2552,7 +2552,14 @@ namespace MWWorld
MWRender::Animation* World::getAnimation(const MWWorld::Ptr &ptr)
{
return mRendering->getAnimation(ptr);
auto* animation = mRendering->getAnimation(ptr);
if(!animation) {
mWorldScene->removeFromPagedRefs(ptr);
animation = mRendering->getAnimation(ptr);
if(animation)
mRendering->pagingBlacklistObject(mStore.find(ptr.getCellRef().getRefId()), ptr);
}
return animation;
}
const MWRender::Animation* World::getAnimation(const MWWorld::ConstPtr &ptr) const

Loading…
Cancel
Save