summaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-22 06:39:32 +0000
committertron <tron@openttd.org>2005-10-22 06:39:32 +0000
commit2cc2154ad26b96b032df2f4fca0ce1634e6330b2 (patch)
tree646e010d91defd66326958b9e15c3eb36077760c /map.c
parent01638700067b9720c187598ad6b4bf786e0e63c1 (diff)
downloadopenttd-2cc2154ad26b96b032df2f4fca0ce1634e6330b2.tar.xz
(svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
nothing spectacular, just some stuff, which piled up
Diffstat (limited to 'map.c')
-rw-r--r--map.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/map.c b/map.c
index f63204767..81b23637f 100644
--- a/map.c
+++ b/map.c
@@ -39,7 +39,6 @@ void AllocateMap(uint size_x, uint size_y)
_map_size = size_x * size_y;
_map_tile_mask = _map_size - 1;
- // free/malloc uses less memory than realloc.
free(_m);
_m = malloc(_map_size * sizeof(*_m));
@@ -111,9 +110,8 @@ uint ScaleByMapSize1D(uint n)
// the result will be tile + TileDiffXY(addx, addy)
uint TileAddWrap(TileIndex tile, int addx, int addy)
{
- uint x, y;
- x = TileX(tile) + addx;
- y = TileY(tile) + addy;
+ uint x = TileX(tile) + addx;
+ uint y = TileY(tile) + addy;
// Are we about to wrap?
if (x < MapMaxX() && y < MapMaxY())
@@ -170,4 +168,3 @@ uint DistanceFromEdge(TileIndex tile)
const uint minh = xh < yh ? xh : yh;
return minl < minh ? minl : minh;
}
-