Core/Grid: Fix crashes when closing up to the edge of a map.

Closes #5085
This commit is contained in:
kaelima
2012-03-28 02:37:39 +02:00
parent ff070bd17e
commit f9caf79b16

View File

@@ -215,7 +215,8 @@ namespace Trinity
inline bool IsValidMapCoord(float c)
{
return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f);
//! Since we visit grids in circles, we cannot allow players to relocate to grids on the edge of a map - thus the use of CENTER_GRID_OFFSET
return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - CENTER_GRID_OFFSET - 0.5f);
}
inline bool IsValidMapCoord(float x, float y)