1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00

Renamed mStoredAvailableNodes to mPopulateAvailableNodes.

Don't call getAllowedNodes() needlessly.
This commit is contained in:
dteviot 2015-07-12 16:32:48 +12:00
parent 11d24fd23b
commit b508846a64
2 changed files with 9 additions and 8 deletions

View File

@ -117,7 +117,7 @@ namespace MWMechanics
mStartTime = MWBase::Environment::get().getWorld()->getTimeStamp();
mStoredAvailableNodes = false;
mPopulateAvailableNodes = true;
}
@ -191,7 +191,7 @@ namespace MWMechanics
if(!currentCell || cellChange)
{
currentCell = actor.getCell();
mStoredAvailableNodes = false; // prob. not needed since mDistance = 0
mPopulateAvailableNodes = true;
}
cStats.setDrawState(DrawState_Nothing);
@ -390,7 +390,7 @@ namespace MWMechanics
}
// Initialization to discover & store allowed node points for this actor.
if(!mStoredAvailableNodes)
if (mPopulateAvailableNodes)
{
getAllowedNodes(actor, currentCell->getCell());
}
@ -640,7 +640,7 @@ namespace MWMechanics
if (mDistance == 0)
return;
if (!mStoredAvailableNodes)
if (mPopulateAvailableNodes)
getAllowedNodes(actor, actor.getCell()->getCell());
if (mAllowedNodes.empty())
@ -660,7 +660,7 @@ namespace MWMechanics
actor.getClass().adjustPosition(actor, false);
// may have changed cell
mStoredAvailableNodes = false;
mPopulateAvailableNodes = true;
}
int AiWander::OffsetToPreventOvercrowding()
@ -722,8 +722,9 @@ namespace MWMechanics
{
SetCurrentNodeToClosestAllowedNode(npcPos);
}
mStoredAvailableNodes = true; // set only if successful in finding allowed nodes
}
mPopulateAvailableNodes = false;
}
// When only one path grid point in wander distance,

View File

@ -88,8 +88,8 @@ namespace MWMechanics
// if false triggers calculating allowed nodes based on mDistance
bool mStoredAvailableNodes;
// do we need to calculate allowed nodes based on mDistance
bool mPopulateAvailableNodes;