From 259d52280088c50f6399f55549f7db8b91d98277 Mon Sep 17 00:00:00 2001 From: fredzio Date: Tue, 15 Dec 2020 21:34:58 +0100 Subject: [PATCH] When doing a ray cast to the next projectile position, ignore collisions that occurs with the projectile own collision object. Otherwise a magic bolt can explode "spontaneously". --- apps/openmw/mwphysics/closestnotmerayresultcallback.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwphysics/closestnotmerayresultcallback.cpp b/apps/openmw/mwphysics/closestnotmerayresultcallback.cpp index 422ca78bd..f9dc3bdd5 100644 --- a/apps/openmw/mwphysics/closestnotmerayresultcallback.cpp +++ b/apps/openmw/mwphysics/closestnotmerayresultcallback.cpp @@ -24,6 +24,10 @@ namespace MWPhysics { if (rayResult.m_collisionObject == mMe) return 1.f; + + if (mProjectile && rayResult.m_collisionObject == mProjectile->getCollisionObject()) + return 1.f; + if (!mTargets.empty()) { if ((std::find(mTargets.begin(), mTargets.end(), rayResult.m_collisionObject) == mTargets.end()))