/// TODO (tluppi#1#): Use ObstacleCheck here. Not working for some reason
//if(mObstacleCheck.check(actor, duration)) {
if(distance(start,mStuckPos.pos[0],mStuckPos.pos[1],mStuckPos.pos[2])<10&&distance(dest,start)>20){//Actually stuck, and far enough away from destination to care
if(distance(start,mStuckPos.pos[0],mStuckPos.pos[1],mStuckPos.pos[2])<actor.getClass().getSpeed(actor)*0.05&&distance(dest,start)>20){//Actually stuck, and far enough away from destination to care
// first check if we're walking into a door
MWWorld::Ptrdoor=getNearbyDoor(actor);
if(door!=MWWorld::Ptr())// NOTE: checks interior cells only
{
if(door.getCellRef().getTrap().empty()&&mLastDoorChecked!=door){//Open the door if untrapped