1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Merge remote-tracking branch 'mrcheko/master'

This commit is contained in:
Marc Zinnschlag 2014-04-30 22:45:26 +02:00
commit 634311c86c
4 changed files with 7 additions and 7 deletions

View file

@ -392,7 +392,7 @@ namespace MWMechanics
else // remote pathfinding else // remote pathfinding
{ {
bool preferShortcut = false; bool preferShortcut = false;
bool inLOS; bool inLOS = MWBase::Environment::get().getWorld()->getLOS(actor, mTarget);
if(mReadyToAttack) isStuck = false; if(mReadyToAttack) isStuck = false;
@ -400,7 +400,7 @@ namespace MWMechanics
if(!isStuck if(!isStuck
&& (!mForceNoShortcut && (!mForceNoShortcut
|| (Ogre::Vector3(mShortcutFailPos.pos) - vActorPos).length() >= PATHFIND_SHORTCUT_RETRY_DIST) || (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); if(speed == 0.0f) speed = actorCls.getSpeed(actor);
// maximum dist before pit/obstacle for actor to avoid them depending on his speed // 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) if(inLOS && mPathFinder.getPath().size() > 1)
{ {
// get point just before target // 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; --pntIter;
Ogre::Vector3 vBeforeTarget = Ogre::Vector3(pntIter->mX, pntIter->mY, pntIter->mZ); Ogre::Vector3 vBeforeTarget = Ogre::Vector3(pntIter->mX, pntIter->mY, pntIter->mZ);

View file

@ -539,14 +539,14 @@ namespace MWMechanics
} }
void AiWander::trimAllowedNodes(std::vector<ESM::Pathgrid::Point>& nodes, 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? // TODO: how to add these back in once the door opens?
// Idea: keep a list of detected closed doors (see aicombat.cpp) // Idea: keep a list of detected closed doors (see aicombat.cpp)
// Every now and then check whether one of the doors is opened. (maybe // 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 // at the end of playing idle?) If the door is opened then re-calculate
// allowed nodes starting from the spawn point. // 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) while(paths.size() >= 2)
{ {
ESM::Pathgrid::Point pt = paths.back(); ESM::Pathgrid::Point pt = paths.back();

View file

@ -77,7 +77,7 @@ namespace MWMechanics
ESM::Pathgrid::Point mCurrentNode; ESM::Pathgrid::Point mCurrentNode;
bool mTrimCurrentNode; bool mTrimCurrentNode;
void trimAllowedNodes(std::vector<ESM::Pathgrid::Point>& nodes, void trimAllowedNodes(std::vector<ESM::Pathgrid::Point>& nodes,
const PathFinder& pathfinder); PathFinder& pathfinder);
PathFinder mPathFinder; PathFinder mPathFinder;

View file

@ -57,7 +57,7 @@ namespace MWMechanics
return mPath.size(); return mPath.size();
} }
std::list<ESM::Pathgrid::Point> getPath() const std::list<ESM::Pathgrid::Point>& getPath()
{ {
return mPath; return mPath;
} }