mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Fix activation distance in third person mode
This commit is contained in:
parent
9375cbea44
commit
67d3571fac
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue