1
0
Fork 0
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:
elsid 2018-03-15 00:42:12 +03:00
parent 0cfdf0c7b6
commit 33dfe284bd
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -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();