1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 01:45:33 +00:00

Fix for issue #50, doors not working when object paging active grid is enabled

This commit is contained in:
Mads Buvik Sandvei 2020-11-27 00:33:31 +01:00
parent acdce6e0d0
commit 349bee3138

View file

@ -3986,6 +3986,18 @@ namespace MWWorld
float World::getTargetObject(MWRender::RayResult& result, osg::Transform* pointer, float maxDistance, bool ignorePlayer)
{
result = mRendering->castRay(pointer, maxDistance, ignorePlayer, false);
MWWorld::Ptr facedObject = result.mHitObject;
if (facedObject.isEmpty() && result.mHitRefnum.hasContentFile())
{
for (CellStore* cellstore : mWorldScene->getActiveCells())
{
facedObject = cellstore->searchViaRefNum(result.mHitRefnum);
if (!facedObject.isEmpty()) break;
}
}
result.mHitObject = facedObject;
if(result.mHit)
return result.mRatio * maxDistance;
return -1.f;