mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Ensures destination is far enough to care about getting stuck
This commit is contained in:
		
							parent
							
								
									cbfa282f8d
								
							
						
					
					
						commit
						2db3c89a9e
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -90,7 +90,7 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, ESM::Pathgrid::Po | |||
|     { | ||||
| /// 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) { //Actually stuck
 | ||||
|         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
 | ||||
|             // first check if we're walking into a door
 | ||||
|             MWWorld::LiveCellRef<ESM::Door>* door = getNearbyDoor(actor); | ||||
|             if(door != NULL) // NOTE: checks interior cells only
 | ||||
|  | @ -125,4 +125,6 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, ESM::Pathgrid::Po | |||
|     } | ||||
| 
 | ||||
|     zTurn(actor, Ogre::Degree(mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]))); | ||||
| 
 | ||||
|     return false; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue