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:
parent
acdce6e0d0
commit
349bee3138
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue