From 67d3571faca5b19c4b09195290774b90b2c08b05 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 10 Jul 2016 17:09:21 +0200 Subject: [PATCH] Fix activation distance in third person mode --- apps/openmw/mwworld/worldimp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cb5756c93..b178e6e52 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1722,7 +1722,8 @@ namespace MWWorld MWWorld::Ptr World::getFacedObject(float maxDistance, bool ignorePlayer) { - maxDistance += mRendering->getCameraDistance(); + const float camDist = mRendering->getCameraDistance(); + maxDistance += camDist; MWWorld::Ptr facedObject; MWRender::RenderingManager::RayResult rayToObject; @@ -1737,7 +1738,7 @@ namespace MWWorld facedObject = rayToObject.mHitObject; if (rayToObject.mHit) - mDistanceToFacedObject = rayToObject.mRatio * maxDistance; + mDistanceToFacedObject = (rayToObject.mRatio * maxDistance) - camDist; else mDistanceToFacedObject = -1; return facedObject;