diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h index 2eeca2637..8d46bb414 100644 --- a/src/game/GridDefines.h +++ b/src/game/GridDefines.h @@ -169,7 +169,7 @@ namespace MaNGOS inline bool IsValidMapCoord(float c) { - return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5); + return !isnan(c) && finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5); } inline bool IsValidMapCoord(float x, float y) @@ -179,12 +179,12 @@ namespace MaNGOS inline bool IsValidMapCoord(float x, float y, float z) { - return IsValidMapCoord(x,y) && finite(z); + return IsValidMapCoord(x,y) && (!isnan(z) && finite(z)); } inline bool IsValidMapCoord(float x, float y, float z, float o) { - return IsValidMapCoord(x,y,z) && finite(o); + return IsValidMapCoord(x,y,z) && (!isnan(0) && finite(o)); } } #endif diff --git a/src/shared/Common.h b/src/shared/Common.h index cd61d2d8d..636aa5fbe 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -125,11 +125,13 @@ typedef off_t ACE_OFF_T; # define snprintf _snprintf # define vsnprintf _vsnprintf # define finite(X) _finite(X) +# define isnan(x) _isnan(x) #else # define stricmp strcasecmp # define strnicmp strncasecmp +# define isnan(x) std::isnan(x) # define I32FMT "%08X" # if ACE_SIZEOF_LONG == 8 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2b28ba9f6..1828d0c5d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11317" + #define REVISION_NR "11318" #endif // __REVISION_NR_H__