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:
parent
df3a47187b
commit
692615fd3c
@ -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…
x
Reference in New Issue
Block a user