forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'dteviot/Bug2871'
This commit is contained in:
commit
50ec8b10f5
6 changed files with 15 additions and 11 deletions
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "autocalcspell.hpp"
|
||||
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
|
@ -181,7 +182,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)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "pathfinding.hpp"
|
||||
#include <limits>
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -53,13 +54,13 @@ namespace
|
|||
{
|
||||
assert(grid && !grid->mPoints.empty());
|
||||
|
||||
float closestDistanceBetween = distanceSquared(grid->mPoints[0], pos);
|
||||
float closestDistanceReachable = closestDistanceBetween;
|
||||
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
|
||||
// points to a quadtree may help
|
||||
for(unsigned int counter = 1; counter < grid->mPoints.size(); counter++)
|
||||
for(unsigned int counter = 0; counter < grid->mPoints.size(); counter++)
|
||||
{
|
||||
float potentialDistBetween = distanceSquared(grid->mPoints[counter], pos);
|
||||
if (potentialDistBetween < closestDistanceReachable)
|
||||
|
@ -78,7 +79,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
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "spellcasting.hpp"
|
||||
|
||||
#include <cfloat>
|
||||
#include <limits>
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
|
@ -92,7 +93,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)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "renderingmanager.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <limits>
|
||||
|
||||
#include <osg/Light>
|
||||
#include <osg/LightModel>
|
||||
|
@ -383,7 +384,7 @@ namespace MWRender
|
|||
if (mFogDepth == 0.f)
|
||||
{
|
||||
mStateUpdater->setFogStart(0.f);
|
||||
mStateUpdater->setFogEnd(FLT_MAX);
|
||||
mStateUpdater->setFogEnd(std::numeric_limits<float>::max());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2654,8 +2654,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();
|
||||
|
@ -2848,7 +2848,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…
Reference in a new issue