mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 21:35:24 +00:00
Fixed moving activatable object being incorrectly activated.
This commit is contained in:
parent
6d540c4e07
commit
203ef580cf
@ -9,7 +9,7 @@
|
|||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
/// \brief Causes actor to walk to activatable object and activate it
|
/// \brief Causes actor to walk to activatable object and activate it
|
||||||
/** Will actiavte when close to object or path grid complete **/
|
/** Will activate when close to object **/
|
||||||
class AiActivate : public AiPackage
|
class AiActivate : public AiPackage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -109,19 +109,15 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, ESM::Pathgrid::Po
|
|||||||
// change the angle a bit, too
|
// change the angle a bit, too
|
||||||
zTurn(actor, Ogre::Degree(mPathFinder.getZAngleToNext(pos.pos[0] + 1, pos.pos[1])));
|
zTurn(actor, Ogre::Degree(mPathFinder.getZAngleToNext(pos.pos[0] + 1, pos.pos[1])));
|
||||||
}
|
}
|
||||||
/*else if(distance(start, mStuckPos.pos[0], mStuckPos.pos[1], mStuckPos.pos[2]) < 10) { //NPC hasn't moved much is half a second, he's stuck
|
|
||||||
actor.getClass().getMovementSettings(actor).mPosition[1] = 0;
|
|
||||||
actor.getClass().getMovementSettings(actor).mPosition[0] = 1;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
else {
|
else { //Not stuck, so reset things
|
||||||
mStuckTimer = 0;
|
mStuckTimer = 0;
|
||||||
mStuckPos = pos;
|
mStuckPos = pos;
|
||||||
mLastDoorChecked = NULL; //Resets it, in case he gets stuck behind the door again
|
mLastDoorChecked = NULL; //Resets it, in case he gets stuck behind the door again
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
actor.getClass().getMovementSettings(actor).mPosition[1] = 1;
|
actor.getClass().getMovementSettings(actor).mPosition[1] = 1; //Just run forward the rest of the time
|
||||||
}
|
}
|
||||||
|
|
||||||
zTurn(actor, Ogre::Degree(mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1])));
|
zTurn(actor, Ogre::Degree(mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1])));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user