diff options
author | Fredi Machado <fredisoft@gmail.com> | 2011-10-17 07:38:27 -0300 |
---|---|---|
committer | Fredi Machado <fredisoft@gmail.com> | 2011-10-17 07:38:27 -0300 |
commit | 97142102e010634cba66259844e90156ed97a3ab (patch) | |
tree | 5d8fa3e91cbb9de247f8ff529f3bb6584c2c9820 /src/server/game/Grids/GridDefines.h | |
parent | 04bb2f4a1707b57d5b5d5af3910ffb690cd8117d (diff) |
Core/Misc: Added 'f' after float values
Diffstat (limited to 'src/server/game/Grids/GridDefines.h')
-rwxr-xr-x | src/server/game/Grids/GridDefines.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index a284e342ca9..66eabf77400 100755 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -133,8 +133,8 @@ namespace Trinity double x_offset = (double(x) - center_offset)/size; double y_offset = (double(y) - center_offset)/size; - int x_val = int(x_offset+CENTER_VAL + 0.5); - int y_val = int(y_offset+CENTER_VAL + 0.5); + int x_val = int(x_offset+CENTER_VAL + 0.5f); + int y_val = int(y_offset+CENTER_VAL + 0.5f); return RET_TYPE(x_val, y_val); } @@ -153,8 +153,8 @@ namespace Trinity double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL; double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL; - int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5); - int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5); + int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5f); + int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5f); x_off = (float(x_offset) - x_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL; y_off = (float(y_offset) - y_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL; return CellPair(x_val, y_val); @@ -162,15 +162,15 @@ namespace Trinity inline void NormalizeMapCoord(float &c) { - if (c > MAP_HALFSIZE - 0.5) - c = MAP_HALFSIZE - 0.5; - else if (c < -(MAP_HALFSIZE - 0.5)) - c = -(MAP_HALFSIZE - 0.5); + if (c > MAP_HALFSIZE - 0.5f) + c = MAP_HALFSIZE - 0.5f; + else if (c < -(MAP_HALFSIZE - 0.5f)) + c = -(MAP_HALFSIZE - 0.5f); } inline bool IsValidMapCoord(float c) { - return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5); + return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f); } inline bool IsValidMapCoord(float x, float y) |