From 64475ebedb803a853c62062eb199df2183076005 Mon Sep 17 00:00:00 2001 From: fredzio Date: Wed, 27 Jan 2021 07:15:09 +0100 Subject: [PATCH] Remove a brainfart from precise projectile handling: all non-actor non-projectile objects were treated as ground. --- apps/openmw/mwphysics/projectileconvexcallback.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwphysics/projectileconvexcallback.cpp b/apps/openmw/mwphysics/projectileconvexcallback.cpp index 0d0ac87202..b803c4400b 100644 --- a/apps/openmw/mwphysics/projectileconvexcallback.cpp +++ b/apps/openmw/mwphysics/projectileconvexcallback.cpp @@ -55,7 +55,9 @@ namespace MWPhysics } default: { - mProjectile->hit(MWWorld::Ptr(), m_hitPointWorld, m_hitNormalWorld); + auto* target = static_cast(result.m_hitCollisionObject->getUserPointer()); + auto ptr = target ? target->getPtr() : MWWorld::Ptr(); + mProjectile->hit(ptr, m_hitPointWorld, m_hitNormalWorld); break; } }