mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[11318] Check for NaN values in IsValidMapCoord() functions.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
8fd323a09a
commit
cce8f56160
3 changed files with 6 additions and 4 deletions
|
|
@ -169,7 +169,7 @@ namespace MaNGOS
|
||||||
|
|
||||||
inline bool IsValidMapCoord(float c)
|
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)
|
inline bool IsValidMapCoord(float x, float y)
|
||||||
|
|
@ -179,12 +179,12 @@ namespace MaNGOS
|
||||||
|
|
||||||
inline bool IsValidMapCoord(float x, float y, float z)
|
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)
|
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
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -125,11 +125,13 @@ typedef off_t ACE_OFF_T;
|
||||||
# define snprintf _snprintf
|
# define snprintf _snprintf
|
||||||
# define vsnprintf _vsnprintf
|
# define vsnprintf _vsnprintf
|
||||||
# define finite(X) _finite(X)
|
# define finite(X) _finite(X)
|
||||||
|
# define isnan(x) _isnan(x)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# define stricmp strcasecmp
|
# define stricmp strcasecmp
|
||||||
# define strnicmp strncasecmp
|
# define strnicmp strncasecmp
|
||||||
|
# define isnan(x) std::isnan(x)
|
||||||
|
|
||||||
# define I32FMT "%08X"
|
# define I32FMT "%08X"
|
||||||
# if ACE_SIZEOF_LONG == 8
|
# if ACE_SIZEOF_LONG == 8
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11317"
|
#define REVISION_NR "11318"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue