From 502a758eff947ab17e6b4adb0d844240c8167bb1 Mon Sep 17 00:00:00 2001 From: Allofich Date: Thu, 8 Sep 2016 01:53:57 +0900 Subject: [PATCH] Use particle texture for "hit" effects --- apps/openmw/mwmechanics/spellcasting.cpp | 7 ++++++- apps/openmw/mwworld/worldimp.cpp | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index f484ff223..1b040fad8 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -541,12 +541,17 @@ namespace MWMechanics else castStatic = MWBase::Environment::get().getWorld()->getStore().get().find ("VFX_DefaultHit"); + std::string texture = ""; + + if (!magicEffect->mParticle.empty() && !(magicEffect->mData.mFlags & ESM::MagicEffect::Harmful)) + texture = magicEffect->mParticle; + // TODO: VFX are no longer active after saving/reloading the game bool loop = (magicEffect->mData.mFlags & ESM::MagicEffect::ContinuousVfx) != 0; // Note: in case of non actor, a free effect should be fine as well MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(target); if (anim) - anim->addEffect("meshes\\" + castStatic->mModel, magicEffect->mIndex, loop, ""); + anim->addEffect("meshes\\" + castStatic->mModel, magicEffect->mIndex, loop, "", texture); } } } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 82f99b7ea..1b8334559 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3163,7 +3163,11 @@ namespace MWWorld const ESM::MagicEffect* effect = getStore().get().find(effectIt->mEffectID); if ((effectIt->mArea <= 0 && !ignore.isEmpty() && ignore.getClass().isActor()) || effectIt->mRange != rangeType) +<<<<<<< fe3a033642f21393bc267afa4edcc373c9d5f80b continue; // Not right range type, or not area effect and hit an actor +======= + continue; // Not right range type +>>>>>>> Use particle texture for "hit" effects // Spawn the explosion orb effect const ESM::Static* areaStatic;