forked from teamnwah/openmw-tes3coop
Fix being able to activate through terrain
This commit is contained in:
parent
750d8b5589
commit
1d46ac19ff
2 changed files with 10 additions and 4 deletions
|
@ -1471,8 +1471,13 @@ namespace MWWorld
|
|||
std::vector < std::pair < float, std::string > >::iterator it = results.begin();
|
||||
while (it != results.end())
|
||||
{
|
||||
if ( (*it).second.find("HeightField") != std::string::npos // not interested in terrain
|
||||
|| getPtrViaHandle((*it).second) == mPlayer->getPlayer() ) // not interested in player (unless you want to talk to yourself)
|
||||
if ((*it).second.find("HeightField") != std::string::npos) // Don't attempt to getPtrViaHandle on terrain
|
||||
{
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (getPtrViaHandle((*it).second) == mPlayer->getPlayer() ) // not interested in player (unless you want to talk to yourself)
|
||||
{
|
||||
it = results.erase(it);
|
||||
}
|
||||
|
@ -1480,7 +1485,8 @@ namespace MWWorld
|
|||
++it;
|
||||
}
|
||||
|
||||
if (results.empty())
|
||||
if (results.empty()
|
||||
|| results.front().second.find("HeightField") != std::string::npos) // Blocked by terrain
|
||||
{
|
||||
mFacedHandle = "";
|
||||
mFacedDistance = FLT_MAX;
|
||||
|
|
|
@ -805,7 +805,7 @@ namespace Physic
|
|||
{
|
||||
MyRayResultCallback resultCallback1;
|
||||
resultCallback1.m_collisionFilterGroup = 0xff;
|
||||
resultCallback1.m_collisionFilterMask = CollisionType_Raycasting|CollisionType_Actor;
|
||||
resultCallback1.m_collisionFilterMask = CollisionType_Raycasting|CollisionType_Actor|CollisionType_HeightMap;
|
||||
mDynamicsWorld->rayTest(from, to, resultCallback1);
|
||||
std::vector< std::pair<float, const btCollisionObject*> > results = resultCallback1.results;
|
||||
|
||||
|
|
Loading…
Reference in a new issue