mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 14:36:39 +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
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue