1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

Merge pull request #1067 from Allofich/intervention

Use correct vfx for teleport spells
This commit is contained in:
scrawl 2016-09-19 14:29:43 +02:00 committed by GitHub
commit acd0a5ea01

View file

@ -646,14 +646,28 @@ namespace MWMechanics
if (target != getPlayer()) if (target != getPlayer())
return false; return false;
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
if (effectId == ESM::MagicEffect::DivineIntervention) if (effectId == ESM::MagicEffect::DivineIntervention)
{ {
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "divinemarker"); MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "divinemarker");
anim->removeEffect(ESM::MagicEffect::DivineIntervention);
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
.search("VFX_Summon_end");
if (fx)
MWBase::Environment::get().getWorld()->spawnEffect("meshes\\" + fx->mModel,
"", mCaster.getRefData().getPosition().asVec3());
return true; return true;
} }
else if (effectId == ESM::MagicEffect::AlmsiviIntervention) else if (effectId == ESM::MagicEffect::AlmsiviIntervention)
{ {
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "templemarker"); MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "templemarker");
anim->removeEffect(ESM::MagicEffect::AlmsiviIntervention);
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
.search("VFX_Summon_end");
if (fx)
MWBase::Environment::get().getWorld()->spawnEffect("meshes\\" + fx->mModel,
"", mCaster.getRefData().getPosition().asVec3());
return true; return true;
} }
@ -674,6 +688,7 @@ namespace MWMechanics
MWWorld::ActionTeleport action(markedCell->isExterior() ? "" : markedCell->getCell()->mName, MWWorld::ActionTeleport action(markedCell->isExterior() ? "" : markedCell->getCell()->mName,
markedPosition, false); markedPosition, false);
action.execute(target); action.execute(target);
anim->removeEffect(ESM::MagicEffect::Recall);
} }
return true; return true;
} }