Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Core/GameEngine/Include/Precompiled/PreRTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class STLSpecialAlloc;
#include <windows.h>

#include <assert.h>
#include <Utility/cmath_adapter.h>
#include <ctype.h>
#include <direct.h>
#include <excpt.h>
Expand Down
4 changes: 2 additions & 2 deletions Core/GameEngine/Source/Common/System/GameCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ static_assert(ARRAY_SIZE(TheRelationshipNames) == RELATIONSHIP_COUNT + 1, "Incor
// TheSuperHackers @todo DO NOT USE THIS FUNCTION! Use WWMath::Normalize_Angle instead. Delete this.
Real normalizeAngle(Real angle)
{
DEBUG_ASSERTCRASH(!_isnan(angle), ("Angle is NAN in normalizeAngle!"));
DEBUG_ASSERTCRASH(!std::isnan(angle), ("Angle is NAN in normalizeAngle!"));

if( _isnan(angle) )
if( std::isnan(angle) )
return 0;// ARGH!!!! Don't assert and then not handle it! Error bad! Fix error!

while (angle > PI)
Expand Down
5 changes: 4 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/motchan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "WWMath/wwmath.h"
#include "WWMath/quat.h"
#include <Utility/bit_adapter.h>
#include <Utility/cmath_adapter.h>
//#include <Windows.h>
// Static Table, for Adaptive Delta Decompressor
#define FILTER_TABLE_SIZE (256)
Expand Down Expand Up @@ -1264,7 +1265,9 @@ return;
int i=0;
for (;i<count;i++) {
float value=Data[i];
if (_isnan(value)) value=0.0f;
if (std::isnan(value))
value=0.0f;

if (value>100000.0f) value=0.0f;
if (value<-100000.0f) value=0.0f;
Data[i]=value;
Expand Down
5 changes: 3 additions & 2 deletions Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "d3d8.h"
#include "statistics.h"
#include <WWDebug/wwprofile.h>
#include <Utility/cmath_adapter.h>
#include <algorithm>
#include <list>

Expand Down Expand Up @@ -474,7 +475,7 @@ void SortingRendererClass::Flush_Sorting_Pool()
tis_ptr->tri.k = idx3 + vertex_array_offset;
tis_ptr->idx = node_id;
tis_ptr->z = (v1->z + v2->z + v3->z)/3.0f;
DEBUG_ASSERTCRASH((! _isnan(tis_ptr->z) && _finite(tis_ptr->z)), ("Triangle has invalid center"));
DEBUG_ASSERTCRASH((! std::isnan(tis_ptr->z) && std::isfinite(tis_ptr->z)), ("Triangle has invalid center"));
}
} else {
for (int i=0;i<state->polygon_count;++i) {
Expand All @@ -497,7 +498,7 @@ void SortingRendererClass::Flush_Sorting_Pool()
tis_ptr->z = (mtx[2][0]*(v1->x + v2->x + v3->x) +
mtx[2][1]*(v1->y + v2->y + v3->y) +
mtx[2][2]*(v1->z + v2->z + v3->z))/3.0f + mtx[2][3];
DEBUG_ASSERTCRASH((! _isnan(tis_ptr->z) && _finite(tis_ptr->z)), ("Triangle has invalid center"));
DEBUG_ASSERTCRASH((! std::isnan(tis_ptr->z) && std::isfinite(tis_ptr->z)), ("Triangle has invalid center"));
}
}

Expand Down
3 changes: 2 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "WWMath/Vector3i.h"
#include "WWLib/RANDOM.h"
#include "WWMath/v3_rnd.h"
#include <Utility/cmath_adapter.h>


/* We have chunking logic which handles N segments at a time. To simplify the subdivision logic,
Expand Down Expand Up @@ -1334,7 +1335,7 @@ void StreakRendererClass::RenderStreak
for (i=0; i<vnum; i++)
{
DEBUG_ASSERTCRASH(vertexArray[i].x != (float)0xdeadbeef && vertexArray[i].y != (float)0xdeadbeef && vertexArray[i].z != (float)0xdeadbeef && vertexArray[i].u1 != (float)0xdeadbeeef && vertexArray[i].v1 != (float)0xdeadbeef, ("Uninitialized vertexArray[%d]", i));
DEBUG_ASSERTCRASH((! _isnan(vertexArray[i].x) && _finite(vertexArray[i].x) && ! _isnan(vertexArray[i].y) && _finite(vertexArray[i].y) && ! _isnan(vertexArray[i].z) && _finite(vertexArray[i].z)) , ("Bad vertexArray[%d]", i));
DEBUG_ASSERTCRASH((! std::isnan(vertexArray[i].x) && std::isfinite(vertexArray[i].x) && ! std::isnan(vertexArray[i].y) && std::isfinite(vertexArray[i].y) && ! std::isnan(vertexArray[i].z) && std::isfinite(vertexArray[i].z)) , ("Bad vertexArray[%d]", i));
vb[i].x = vertexArray[i].x;
vb[i].y = vertexArray[i].y;
vb[i].z = vertexArray[i].z;
Expand Down
7 changes: 3 additions & 4 deletions Core/Libraries/Source/WWVegas/WWMath/wwmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,7 @@ WWINLINE double WWMath::Inverse_Lerp(double a, double b, float v)

WWINLINE bool WWMath::Is_Valid_Float(float x)
{
unsigned long * plong = (unsigned long *)(&x);
unsigned long exponent = ((*plong) & 0x7F800000) >> (32-9);
unsigned int exponent = (std::bit_cast<unsigned int>(x) & 0x7F800000) >> (32-9);

// if exponent is 0xFF, this is a NAN
if (exponent == 0xFF) {
Expand All @@ -979,8 +978,8 @@ WWINLINE bool WWMath::Is_Valid_Float(float x)

WWINLINE bool WWMath::Is_Valid_Double(double x)
{
unsigned long * plong = (unsigned long *)(&x) + 1;
unsigned long exponent = ((*plong) & 0x7FF00000) >> (32-12);
unsigned int high = (unsigned int)(std::bit_cast<unsigned __int64>(x) >> 32);
unsigned int exponent = (high & 0x7FF00000) >> (32-12);

// if exponent is 0x7FF, this is a NAN
if (exponent == 0x7FF) {
Expand Down
1 change: 1 addition & 0 deletions Dependencies/Utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(UTILITY_SRC
Utility/atomic_adapter.h
Utility/atomic_x86interlocked.inl
Utility/bit_adapter.h
Utility/cmath_adapter.h
Utility/compat.h
Utility/comsupp_compat.h
Utility/endian_compat.h
Expand Down
60 changes: 60 additions & 0 deletions Dependencies/Utility/Utility/cmath_adapter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2026 TheSuperHackers
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// This file provides std::isnan and std::isfinite. The <cmath> of VC6 and STLport 4.5.3 has neither, and VC6
// gets functions that call _isnan and _finite of <float.h>.
//
// The VC6 functions differ from the standard functions in these points:
// - There are only float and double overloads. An integer or long double argument is ambiguous.
// - A float argument is converted to double before the check. NaN and infinity stay NaN and infinity in that
// conversion, so the result is the same.

#pragma once

#if defined(_MSC_VER) && _MSC_VER < 1300

#include <float.h>

namespace std
{
inline bool isnan(float x)
Comment thread
xezon marked this conversation as resolved.
Resolved
{
return _isnan(x) != 0;
}

inline bool isnan(double x)
{
return _isnan(x) != 0;
}

inline bool isfinite(float x)
{
return _finite(x) != 0;
}

inline bool isfinite(double x)
{
return _finite(x) != 0;
}
}

#else

#include <cmath>

#endif
10 changes: 5 additions & 5 deletions Generals/Code/GameEngine/Source/Common/Thing/Thing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void Thing::setPositionZ( Real z )
TheTerrainLogic->alignOnTerrain(getOrientation(), pos, stickToGround, mtx );
setTransformMatrix(&mtx);
}
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//=============================================================================
Expand All @@ -181,7 +181,7 @@ void Thing::setPosition( const Coord3D *pos )
Coord3D oldPos = m_cachedPos;
Matrix3D oldMtx = m_transform;

//DEBUG_ASSERTCRASH(!(_isnan(pos->x) || _isnan(pos->y) || _isnan(pos->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
//DEBUG_ASSERTCRASH(!(std::isnan(pos->x) || std::isnan(pos->y) || std::isnan(pos->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
m_transform.Set_X_Translation( pos->x );
m_transform.Set_Y_Translation( pos->y );
m_transform.Set_Z_Translation( pos->z );
Expand All @@ -197,7 +197,7 @@ void Thing::setPosition( const Coord3D *pos )
TheTerrainLogic->alignOnTerrain(getOrientation(), *pos, stickToGround, mtx );
setTransformMatrix(&mtx);
}
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//=============================================================================
Expand Down Expand Up @@ -247,7 +247,7 @@ void Thing::setOrientation( Real angle )
m_cacheFlags &= ~VALID_DIRVECTOR; // but don't clear the altitude flags.

reactToTransformChange(&oldMtx, &oldPos, oldAngle);
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//=============================================================================
Expand All @@ -268,7 +268,7 @@ void Thing::setTransformMatrix( const Matrix3D *mx )
m_cacheFlags = 0;

reactToTransformChange(&oldMtx, &oldPos, oldAngle);
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//-------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Source/GameClient/Drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,7 +2484,7 @@ const AudioEventRTS& Drawable::getAmbientSoundByDamage(BodyDamageType dt)
void Drawable::validatePos() const
{
const Coord3D* ourPos = getPosition();
if (_isnan(ourPos->x) || _isnan(ourPos->y) || _isnan(ourPos->z))
if (std::isnan(ourPos->x) || std::isnan(ourPos->y) || std::isnan(ourPos->z))
{
DEBUG_CRASH(("Drawable/Object position NAN! '%s'", getTemplate()->getName().str()));
}
Expand Down
3 changes: 2 additions & 1 deletion Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,8 @@ void Object::reactToTurretChange( WhichTurretType turret, Real oldRotation, Real
void Object::reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPos, Real oldAngle)
{
//USE_PERF_TIMER(Object_reactToTransformChange)
if(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)) {
if(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z))
{
DEBUG_CRASH(("Object pos is nan."));
TheGameLogic->destroyObject(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ void AIUpdateInterface::setLocomotorGoalPositionExplicit(const Coord3D& newPos)
m_locomotorGoalType = POSITION_EXPLICIT;
m_locomotorGoalData = newPos;
#ifdef RTS_DEBUG
if (_isnan(m_locomotorGoalData.x) || _isnan(m_locomotorGoalData.y) || _isnan(m_locomotorGoalData.z))
if (std::isnan(m_locomotorGoalData.x) || std::isnan(m_locomotorGoalData.y) || std::isnan(m_locomotorGoalData.z))
{
DEBUG_CRASH(("NAN in setLocomotorGoalPositionExplicit"));
}
Expand All @@ -2304,7 +2304,7 @@ void AIUpdateInterface::setLocomotorGoalOrientation(Real angle)
m_locomotorGoalType = ANGLE;
m_locomotorGoalData.x = angle;
#ifdef RTS_DEBUG
if (_isnan(m_locomotorGoalData.x) || _isnan(m_locomotorGoalData.y) || _isnan(m_locomotorGoalData.z))
if (std::isnan(m_locomotorGoalData.x) || std::isnan(m_locomotorGoalData.y) || std::isnan(m_locomotorGoalData.z))
{
DEBUG_CRASH(("NAN in setLocomotorGoalOrientation"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ void PhysicsBehavior::applyForce( const Coord3D *force )
{
// TheSuperHackers @info helmutbuhler 06/05/2025 This debug mutates the code to become CRC incompatible
#if defined(RTS_DEBUG) || !RETAIL_COMPATIBLE_CRC
DEBUG_ASSERTCRASH(!(_isnan(force->x) || _isnan(force->y) || _isnan(force->z)), ("PhysicsBehavior::applyForce force NAN!"));
DEBUG_ASSERTCRASH(!(std::isnan(force->x) || std::isnan(force->y) || std::isnan(force->z)), ("PhysicsBehavior::applyForce force NAN!"));
#endif
if (_isnan(force->x) || _isnan(force->y) || _isnan(force->z)) {
if (std::isnan(force->x) || std::isnan(force->y) || std::isnan(force->z))
{
return;
}
// F = ma --> a = F/m (divide force by mass)
Expand All @@ -319,8 +320,8 @@ void PhysicsBehavior::applyForce( const Coord3D *force )
m_accel.y += modForce.y * massInv;
m_accel.z += modForce.z * massInv;

//DEBUG_ASSERTCRASH(!(_isnan(m_accel.x) || _isnan(m_accel.y) || _isnan(m_accel.z)), ("PhysicsBehavior::applyForce accel NAN!"));
//DEBUG_ASSERTCRASH(!(_isnan(m_vel.x) || _isnan(m_vel.y) || _isnan(m_vel.z)), ("PhysicsBehavior::applyForce vel NAN!"));
//DEBUG_ASSERTCRASH(!(std::isnan(m_accel.x) || std::isnan(m_accel.y) || std::isnan(m_accel.z)), ("PhysicsBehavior::applyForce accel NAN!"));
//DEBUG_ASSERTCRASH(!(std::isnan(m_vel.x) || std::isnan(m_vel.y) || std::isnan(m_vel.z)), ("PhysicsBehavior::applyForce vel NAN!"));
//DEBUG_ASSERTCRASH(fabs(force->z) < 3, ("unlikely z-force"));
#ifdef SLEEPY_PHYSICS
if (getFlag(IS_IN_UPDATE))
Expand Down Expand Up @@ -593,8 +594,9 @@ UpdateSleepTime PhysicsBehavior::update()
mtx.Adjust_Z_Translation(m_vel.z);
}

if (_isnan(mtx.Get_X_Translation()) || _isnan(mtx.Get_Y_Translation()) ||
_isnan(mtx.Get_Z_Translation())) {
if (std::isnan(mtx.Get_X_Translation()) || std::isnan(mtx.Get_Y_Translation()) ||
std::isnan(mtx.Get_Z_Translation()))
{
DEBUG_CRASH(("Object position is NAN, deleting."));
TheGameLogic->destroyObject(obj);
}
Expand Down Expand Up @@ -1339,7 +1341,7 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3
force.x = factor * delta.x / dist;
force.y = factor * delta.y / dist;
force.z = factor * delta.z / dist; // will be zero for 2d case.
DEBUG_ASSERTCRASH(!(_isnan(force.x) || _isnan(force.y) || _isnan(force.z)), ("PhysicsBehavior::onCollide force NAN!"));
DEBUG_ASSERTCRASH(!(std::isnan(force.x) || std::isnan(force.y) || std::isnan(force.z)), ("PhysicsBehavior::onCollide force NAN!"));

applyForce( &force );
}
Expand Down
10 changes: 5 additions & 5 deletions GeneralsMD/Code/GameEngine/Source/Common/Thing/Thing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void Thing::setPositionZ( Real z )
TheTerrainLogic->alignOnTerrain(getOrientation(), pos, stickToGround, mtx );
setTransformMatrix(&mtx);
}
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//=============================================================================
Expand All @@ -181,7 +181,7 @@ void Thing::setPosition( const Coord3D *pos )
Coord3D oldPos = m_cachedPos;
Matrix3D oldMtx = m_transform;

//DEBUG_ASSERTCRASH(!(_isnan(pos->x) || _isnan(pos->y) || _isnan(pos->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
//DEBUG_ASSERTCRASH(!(std::isnan(pos->x) || std::isnan(pos->y) || std::isnan(pos->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
m_transform.Set_X_Translation( pos->x );
m_transform.Set_Y_Translation( pos->y );
m_transform.Set_Z_Translation( pos->z );
Expand All @@ -197,7 +197,7 @@ void Thing::setPosition( const Coord3D *pos )
TheTerrainLogic->alignOnTerrain(getOrientation(), *pos, stickToGround, mtx );
setTransformMatrix(&mtx);
}
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//=============================================================================
Expand Down Expand Up @@ -247,7 +247,7 @@ void Thing::setOrientation( Real angle )
m_cacheFlags &= ~VALID_DIRVECTOR; // but don't clear the altitude flags.

reactToTransformChange(&oldMtx, &oldPos, oldAngle);
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//=============================================================================
Expand All @@ -268,7 +268,7 @@ void Thing::setTransformMatrix( const Matrix3D *mx )
m_cacheFlags = 0;

reactToTransformChange(&oldMtx, &oldPos, oldAngle);
DEBUG_ASSERTCRASH(!(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
DEBUG_ASSERTCRASH(!(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z)), ("Drawable/Object position NAN! '%s'", m_template->getName().str() ));
}

//-------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@ const AudioEventRTS& Drawable::getAmbientSoundByDamage(BodyDamageType dt)
void Drawable::validatePos() const
{
const Coord3D* ourPos = getPosition();
if (_isnan(ourPos->x) || _isnan(ourPos->y) || _isnan(ourPos->z))
if (std::isnan(ourPos->x) || std::isnan(ourPos->y) || std::isnan(ourPos->z))
{
DEBUG_CRASH(("Drawable/Object position NAN! '%s'", getTemplate()->getName().str()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,8 @@ void Object::reactToTurretChange( WhichTurretType turret, Real oldRotation, Real
void Object::reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPos, Real oldAngle)
{
//USE_PERF_TIMER(Object_reactToTransformChange)
if(_isnan(getPosition()->x) || _isnan(getPosition()->y) || _isnan(getPosition()->z)) {
if(std::isnan(getPosition()->x) || std::isnan(getPosition()->y) || std::isnan(getPosition()->z))
{
DEBUG_CRASH(("Object pos is nan."));
TheGameLogic->destroyObject(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ void AIUpdateInterface::setLocomotorGoalPositionExplicit(const Coord3D& newPos)
m_locomotorGoalType = POSITION_EXPLICIT;
m_locomotorGoalData = newPos;
#ifdef RTS_DEBUG
if (_isnan(m_locomotorGoalData.x) || _isnan(m_locomotorGoalData.y) || _isnan(m_locomotorGoalData.z))
if (std::isnan(m_locomotorGoalData.x) || std::isnan(m_locomotorGoalData.y) || std::isnan(m_locomotorGoalData.z))
{
DEBUG_CRASH(("NAN in setLocomotorGoalPositionExplicit"));
}
Expand All @@ -2346,7 +2346,7 @@ void AIUpdateInterface::setLocomotorGoalOrientation(Real angle)
m_locomotorGoalType = ANGLE;
m_locomotorGoalData.x = angle;
#ifdef RTS_DEBUG
if (_isnan(m_locomotorGoalData.x) || _isnan(m_locomotorGoalData.y) || _isnan(m_locomotorGoalData.z))
if (std::isnan(m_locomotorGoalData.x) || std::isnan(m_locomotorGoalData.y) || std::isnan(m_locomotorGoalData.z))
{
DEBUG_CRASH(("NAN in setLocomotorGoalOrientation"));
}
Expand Down
Loading