From 42284603f7624337ad900a338e69b1fe89b50dae Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 20 Jan 2014 13:43:21 +0100 Subject: [PATCH] Properly handle on target effects with mArea=0 --- apps/openmw/mwworld/worldimp.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index ccb16d5fb..419558387 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2229,6 +2229,23 @@ namespace MWWorld if (obstacle == ptr) continue; + MWWorld::Ptr caster = searchPtrViaHandle(it->second.mActorHandle); + if (caster.isEmpty()) + caster = obstacle; + + if (obstacle.isEmpty()) + { + // Terrain + } + else + { + MWMechanics::CastSpell cast(caster, obstacle); + cast.mId = it->second.mId; + cast.mSourceName = it->second.mSourceName; + cast.mStack = it->second.mStack; + cast.inflict(obstacle, caster, it->second.mEffects, ESM::RT_Target); + } + explode = true; } @@ -2240,6 +2257,9 @@ namespace MWWorld { const ESM::MagicEffect* effect = getStore().get().find(effectIt->mEffectID); + if (effectIt->mArea <= 0) + continue; // Not an area effect + // Spawn the explosion orb effect const ESM::Static* areaStatic; if (!effect->mCasting.empty())