Skip to content

Commit

Permalink
[11319] Revert "[11318] Check for NaN values in IsValidMapCoord() fun…
Browse files Browse the repository at this point in the history
…ctions." Function finite(X) always(!) checks for NaN values.

Signed-off-by: Ambal <pogrebniak@gala.net>
  • Loading branch information
Ambal committed Apr 6, 2011
1 parent d107087 commit 09aa268
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/game/GridDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace MaNGOS

inline bool IsValidMapCoord(float c)
{
return !isnan(c) && finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5);
return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5);
}

inline bool IsValidMapCoord(float x, float y)
Expand All @@ -179,12 +179,12 @@ namespace MaNGOS

inline bool IsValidMapCoord(float x, float y, float z)
{
return IsValidMapCoord(x,y) && (!isnan(z) && finite(z));
return IsValidMapCoord(x,y) && finite(z);
}

inline bool IsValidMapCoord(float x, float y, float z, float o)
{
return IsValidMapCoord(x,y,z) && (!isnan(0) && finite(o));
return IsValidMapCoord(x,y,z) && finite(o);
}
}
#endif
2 changes: 0 additions & 2 deletions src/shared/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,11 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11318"
#define REVISION_NR "11319"
#endif // __REVISION_NR_H__

0 comments on commit 09aa268

Please sign in to comment.