replaced FLT_MAX with numeric_limits.

sceneinput
dteviot 9 years ago
parent 3b231b85bb
commit 85bc41dedb

@ -806,7 +806,7 @@ namespace MWMechanics
void AiWander::SetCurrentNodeToClosestAllowedNode(osg::Vec3f npcPos)
{
float distanceToClosestNode = FLT_MAX;
float distanceToClosestNode = std::numeric_limits<float>::max();
unsigned int index = 0;
for (unsigned int counterThree = 0; counterThree < mAllowedNodes.size(); counterThree++)
{

@ -181,7 +181,7 @@ namespace MWMechanics
void calcWeakestSchool (const ESM::Spell* spell, const int* actorSkills, int& effectiveSchool, float& skillTerm)
{
float minChance = FLT_MAX;
float minChance = std::numeric_limits<float>::max();
const ESM::EffectList& effects = spell->mEffects;
for (std::vector<ESM::ENAMstruct>::const_iterator it = effects.mList.begin(); it != effects.mList.end(); ++it)

@ -53,8 +53,8 @@ namespace
{
assert(grid && !grid->mPoints.empty());
float closestDistanceBetween = FLT_MAX;
float closestDistanceReachable = FLT_MAX;
float closestDistanceBetween = std::numeric_limits<float>::max();
float closestDistanceReachable = std::numeric_limits<float>::max();
int closestIndex = 0;
int closestReachableIndex = 0;
// TODO: if this full scan causes performance problems mapping pathgrid
@ -78,7 +78,7 @@ namespace
}
}
// invariant: start and endpoint must be connected
// post-condition: start and endpoint must be connected
assert(cell->isPointConnected(start, closestReachableIndex));
// AiWander has logic that depends on whether a path was created, deleting

@ -92,7 +92,7 @@ namespace MWMechanics
if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude())
return 0;
float y = FLT_MAX;
float y = std::numeric_limits<float>::max();
float lowestSkill = 0;
for (std::vector<ESM::ENAMstruct>::const_iterator it = spell->mEffects.mList.begin(); it != spell->mEffects.mList.end(); ++it)

@ -383,7 +383,7 @@ namespace MWRender
if (mFogDepth == 0.f)
{
mStateUpdater->setFogStart(0.f);
mStateUpdater->setFogEnd(FLT_MAX);
mStateUpdater->setFogEnd(std::numeric_limits<float>::max());
}
else
{

@ -2659,8 +2659,8 @@ namespace MWWorld
MWRender::RenderingManager::RayResult result2 = mRendering->castRay(origin, dest, true, true);
float dist1 = FLT_MAX;
float dist2 = FLT_MAX;
float dist1 = std::numeric_limits<float>::max();
float dist2 = std::numeric_limits<float>::max();
if (result1.mHit)
dist1 = (origin - result1.mHitPos).length();
@ -2853,7 +2853,7 @@ namespace MWWorld
MWWorld::Ptr World::getClosestMarkerFromExteriorPosition( const osg::Vec3f& worldPos, const std::string &id ) {
MWWorld::Ptr closestMarker;
float closestDistance = FLT_MAX;
float closestDistance = std::numeric_limits<float>::max();
std::vector<MWWorld::Ptr> markers;
mCells.getExteriorPtrs(id, markers);

Loading…
Cancel
Save