1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

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

This commit is contained in:
Evil Eye 2021-06-23 18:08:49 +02:00
parent df3a47187b
commit 692615fd3c
2 changed files with 15 additions and 6 deletions

View File

@ -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();

View File

@ -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