Fix being able to activate through terrain

deque
scrawl 11 years ago
parent 750d8b5589
commit 1d46ac19ff

@ -1471,8 +1471,13 @@ namespace MWWorld
std::vector < std::pair < float, std::string > >::iterator it = results.begin(); std::vector < std::pair < float, std::string > >::iterator it = results.begin();
while (it != results.end()) while (it != results.end())
{ {
if ( (*it).second.find("HeightField") != std::string::npos // not interested in terrain if ((*it).second.find("HeightField") != std::string::npos) // Don't attempt to getPtrViaHandle on terrain
|| getPtrViaHandle((*it).second) == mPlayer->getPlayer() ) // not interested in player (unless you want to talk to yourself) {
++it;
continue;
}
if (getPtrViaHandle((*it).second) == mPlayer->getPlayer() ) // not interested in player (unless you want to talk to yourself)
{ {
it = results.erase(it); it = results.erase(it);
} }
@ -1480,7 +1485,8 @@ namespace MWWorld
++it; ++it;
} }
if (results.empty()) if (results.empty()
|| results.front().second.find("HeightField") != std::string::npos) // Blocked by terrain
{ {
mFacedHandle = ""; mFacedHandle = "";
mFacedDistance = FLT_MAX; mFacedDistance = FLT_MAX;

@ -805,7 +805,7 @@ namespace Physic
{ {
MyRayResultCallback resultCallback1; MyRayResultCallback resultCallback1;
resultCallback1.m_collisionFilterGroup = 0xff; 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); mDynamicsWorld->rayTest(from, to, resultCallback1);
std::vector< std::pair<float, const btCollisionObject*> > results = resultCallback1.results; std::vector< std::pair<float, const btCollisionObject*> > results = resultCallback1.results;

Loading…
Cancel
Save