mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Merge remote-tracking branch 'mrcheko/master'
This commit is contained in:
		
						commit
						634311c86c
					
				
					 4 changed files with 7 additions and 7 deletions
				
			
		|  | @ -392,7 +392,7 @@ namespace MWMechanics | |||
|         else // remote pathfinding
 | ||||
|         { | ||||
|             bool preferShortcut = false; | ||||
|             bool inLOS; | ||||
|             bool inLOS = MWBase::Environment::get().getWorld()->getLOS(actor, mTarget); | ||||
| 
 | ||||
|             if(mReadyToAttack) isStuck = false; | ||||
| 			 | ||||
|  | @ -400,7 +400,7 @@ namespace MWMechanics | |||
|             if(!isStuck  | ||||
|                 && (!mForceNoShortcut | ||||
|                 || (Ogre::Vector3(mShortcutFailPos.pos) - vActorPos).length() >= PATHFIND_SHORTCUT_RETRY_DIST) | ||||
|                 && (inLOS = MWBase::Environment::get().getWorld()->getLOS(actor, mTarget))) | ||||
|                 && inLOS) | ||||
|             { | ||||
|                 if(speed == 0.0f) speed = actorCls.getSpeed(actor); | ||||
|                 // maximum dist before pit/obstacle for actor to avoid them depending on his speed
 | ||||
|  | @ -437,7 +437,7 @@ namespace MWMechanics | |||
|                 if(inLOS && mPathFinder.getPath().size() > 1) | ||||
|                 { | ||||
|                     // get point just before target
 | ||||
|                     std::list<ESM::Pathgrid::Point>::iterator pntIter = --mPathFinder.getPath().end(); | ||||
|                     std::list<ESM::Pathgrid::Point>::const_iterator pntIter = --mPathFinder.getPath().end(); | ||||
|                     --pntIter; | ||||
|                     Ogre::Vector3 vBeforeTarget = Ogre::Vector3(pntIter->mX, pntIter->mY, pntIter->mZ); | ||||
| 
 | ||||
|  |  | |||
|  | @ -539,14 +539,14 @@ namespace MWMechanics | |||
|     } | ||||
| 
 | ||||
|     void AiWander::trimAllowedNodes(std::vector<ESM::Pathgrid::Point>& nodes, | ||||
|                                     const PathFinder& pathfinder) | ||||
|                                     PathFinder& pathfinder) | ||||
|     { | ||||
|         // TODO: how to add these back in once the door opens?
 | ||||
|         // Idea: keep a list of detected closed doors (see aicombat.cpp)
 | ||||
|         // Every now and then check whether one of the doors is opened. (maybe
 | ||||
|         // at the end of playing idle?) If the door is opened then re-calculate
 | ||||
|         // allowed nodes starting from the spawn point.
 | ||||
|         std::list<ESM::Pathgrid::Point> paths = pathfinder.getPath(); | ||||
|         std::list<ESM::Pathgrid::Point>& paths = pathfinder.getPath(); | ||||
|         while(paths.size() >= 2) | ||||
|         { | ||||
|             ESM::Pathgrid::Point pt = paths.back(); | ||||
|  |  | |||
|  | @ -77,7 +77,7 @@ namespace MWMechanics | |||
|             ESM::Pathgrid::Point mCurrentNode; | ||||
|             bool mTrimCurrentNode; | ||||
|             void trimAllowedNodes(std::vector<ESM::Pathgrid::Point>& nodes, | ||||
|                                   const PathFinder& pathfinder); | ||||
|                                   PathFinder& pathfinder); | ||||
| 
 | ||||
|             PathFinder mPathFinder; | ||||
| 
 | ||||
|  |  | |||
|  | @ -57,7 +57,7 @@ namespace MWMechanics | |||
|                 return mPath.size(); | ||||
|             } | ||||
| 
 | ||||
|             std::list<ESM::Pathgrid::Point> getPath() const | ||||
|             std::list<ESM::Pathgrid::Point>& getPath() | ||||
|             { | ||||
|                 return mPath; | ||||
|             } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue