diff --git a/apps/openmw/mwmechanics/aiescort.hpp b/apps/openmw/mwmechanics/aiescort.hpp index f7761e58f9e..e4319b425cd 100644 --- a/apps/openmw/mwmechanics/aiescort.hpp +++ b/apps/openmw/mwmechanics/aiescort.hpp @@ -44,7 +44,7 @@ namespace MWMechanics void fastForward(const MWWorld::Ptr& actor, AiState& state); - virtual osg::Vec3f getDestination() { return osg::Vec3f(mX, mY, mZ); } + virtual osg::Vec3f getDestination() const { return osg::Vec3f(mX, mY, mZ); } private: std::string mCellId; diff --git a/apps/openmw/mwmechanics/aifollow.hpp b/apps/openmw/mwmechanics/aifollow.hpp index 7b5a9e63efe..24263bbc0b5 100644 --- a/apps/openmw/mwmechanics/aifollow.hpp +++ b/apps/openmw/mwmechanics/aifollow.hpp @@ -76,7 +76,7 @@ namespace MWMechanics void fastForward(const MWWorld::Ptr& actor, AiState& state); - virtual osg::Vec3f getDestination() + virtual osg::Vec3f getDestination() const { MWWorld::Ptr target = getTarget(); if (target.isEmpty()) diff --git a/apps/openmw/mwmechanics/aipackage.hpp b/apps/openmw/mwmechanics/aipackage.hpp index b9b3baf6436..ec0715e5251 100644 --- a/apps/openmw/mwmechanics/aipackage.hpp +++ b/apps/openmw/mwmechanics/aipackage.hpp @@ -102,7 +102,7 @@ namespace MWMechanics /// Return true if this package should repeat. Currently only used for Wander packages. virtual bool getRepeat() const; - virtual osg::Vec3f getDestination() { return osg::Vec3f(0, 0, 0); } + virtual osg::Vec3f getDestination() const { return osg::Vec3f(0, 0, 0); } // Return true if any loaded actor with this AI package must be active. virtual bool alwaysActive() const { return false; } diff --git a/apps/openmw/mwmechanics/aitravel.hpp b/apps/openmw/mwmechanics/aitravel.hpp index a333c83fd07..e7895462f4a 100644 --- a/apps/openmw/mwmechanics/aitravel.hpp +++ b/apps/openmw/mwmechanics/aitravel.hpp @@ -36,7 +36,7 @@ namespace MWMechanics virtual bool alwaysActive() const { return true; } - virtual osg::Vec3f getDestination() { return osg::Vec3f(mX, mY, mZ); } + virtual osg::Vec3f getDestination() const { return osg::Vec3f(mX, mY, mZ); } private: float mX; diff --git a/apps/openmw/mwmechanics/aiwander.hpp b/apps/openmw/mwmechanics/aiwander.hpp index 38123a970c6..767c8c2e3f0 100644 --- a/apps/openmw/mwmechanics/aiwander.hpp +++ b/apps/openmw/mwmechanics/aiwander.hpp @@ -97,6 +97,8 @@ namespace MWMechanics virtual int getTypeId() const; + virtual bool useVariableSpeed() const { return true;} + virtual void writeState(ESM::AiSequence::AiSequence &sequence) const; virtual void fastForward(const MWWorld::Ptr& actor, AiState& state); @@ -105,6 +107,14 @@ namespace MWMechanics osg::Vec3f getDestination(const MWWorld::Ptr& actor) const; + virtual osg::Vec3f getDestination() const + { + if (!mHasDestination) + return osg::Vec3f(0, 0, 0); + + return mDestination; + } + private: // NOTE: mDistance and mDuration must be set already void init();