1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-31 07:06:45 +00:00

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".
This commit is contained in:
fredzio 2020-12-15 21:34:58 +01:00
parent 884b434ee0
commit 259d522800

View file

@ -24,6 +24,10 @@ namespace MWPhysics
{ {
if (rayResult.m_collisionObject == mMe) if (rayResult.m_collisionObject == mMe)
return 1.f; return 1.f;
if (mProjectile && rayResult.m_collisionObject == mProjectile->getCollisionObject())
return 1.f;
if (!mTargets.empty()) if (!mTargets.empty())
{ {
if ((std::find(mTargets.begin(), mTargets.end(), rayResult.m_collisionObject) == mTargets.end())) if ((std::find(mTargets.begin(), mTargets.end(), rayResult.m_collisionObject) == mTargets.end()))