mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-30 19:11:23 +00:00
Mark local variables const which one does not change
This commit is contained in:
parent
0cfdf0c7b6
commit
33dfe284bd
1 changed files with 7 additions and 7 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
MWMechanics::AiPackage::~AiPackage() {}
|
MWMechanics::AiPackage::~AiPackage() {}
|
||||||
|
|
||||||
MWMechanics::AiPackage::AiPackage() :
|
MWMechanics::AiPackage::AiPackage() :
|
||||||
mTimer(AI_REACTION_TIME + 1.0f), // to force initial pathbuild
|
mTimer(AI_REACTION_TIME + 1.0f), // to force initial pathbuild
|
||||||
mTargetActorRefId(""),
|
mTargetActorRefId(""),
|
||||||
mTargetActorId(-1),
|
mTargetActorId(-1),
|
||||||
|
@ -100,7 +100,7 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const ESM::Pathgr
|
||||||
{
|
{
|
||||||
mTimer += duration; //Update timer
|
mTimer += duration; //Update timer
|
||||||
|
|
||||||
ESM::Position pos = actor.getRefData().getPosition(); //position of the actor
|
const ESM::Position pos = actor.getRefData().getPosition(); //position of the actor
|
||||||
|
|
||||||
/// Stops the actor when it gets too close to a unloaded cell
|
/// Stops the actor when it gets too close to a unloaded cell
|
||||||
//... At current time, this test is unnecessary. AI shuts down when actor is more than 7168
|
//... At current time, this test is unnecessary. AI shuts down when actor is more than 7168
|
||||||
|
@ -113,17 +113,17 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const ESM::Pathgr
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle path building and shortcutting
|
// handle path building and shortcutting
|
||||||
ESM::Pathgrid::Point start = pos.pos;
|
const ESM::Pathgrid::Point start = pos.pos;
|
||||||
|
|
||||||
float distToTarget = distance(start, dest);
|
const float distToTarget = distance(start, dest);
|
||||||
bool isDestReached = (distToTarget <= destTolerance);
|
const bool isDestReached = (distToTarget <= destTolerance);
|
||||||
|
|
||||||
if (!isDestReached && mTimer > AI_REACTION_TIME)
|
if (!isDestReached && mTimer > AI_REACTION_TIME)
|
||||||
{
|
{
|
||||||
if (actor.getClass().isBipedal(actor))
|
if (actor.getClass().isBipedal(actor))
|
||||||
openDoors(actor);
|
openDoors(actor);
|
||||||
|
|
||||||
bool wasShortcutting = mIsShortcutting;
|
const bool wasShortcutting = mIsShortcutting;
|
||||||
bool destInLOS = false;
|
bool destInLOS = false;
|
||||||
|
|
||||||
const MWWorld::Class& actorClass = actor.getClass();
|
const MWWorld::Class& actorClass = actor.getClass();
|
||||||
|
@ -381,7 +381,7 @@ bool MWMechanics::AiPackage::isReachableRotatingOnTheRun(const MWWorld::Ptr& act
|
||||||
osg::Vec3f radiusDir = dir ^ osg::Z_AXIS; // radius is perpendicular to a tangent
|
osg::Vec3f radiusDir = dir ^ osg::Z_AXIS; // radius is perpendicular to a tangent
|
||||||
radiusDir.normalize();
|
radiusDir.normalize();
|
||||||
radiusDir *= radius;
|
radiusDir *= radius;
|
||||||
|
|
||||||
// pick up the nearest center candidate
|
// pick up the nearest center candidate
|
||||||
osg::Vec3f dest_ = PathFinder::MakeOsgVec3(dest);
|
osg::Vec3f dest_ = PathFinder::MakeOsgVec3(dest);
|
||||||
osg::Vec3f pos = actor.getRefData().getPosition().asVec3();
|
osg::Vec3f pos = actor.getRefData().getPosition().asVec3();
|
||||||
|
|
Loading…
Reference in a new issue