1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

(svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts

DiagDirections, and add TileOffsByDir that handles Directions.
-Codechange: Make the treeloop use TileOffsByDir().
This commit is contained in:
Darkvater
2006-09-05 23:21:41 +00:00
parent 516d412a77
commit 80814dbb1d
29 changed files with 111 additions and 102 deletions

View File

@@ -509,17 +509,6 @@ static void TileLoopTreesAlps(TileIndex tile)
static void TileLoop_Trees(TileIndex tile)
{
static const TileIndexDiffC _tileloop_trees_dir[] = {
{-1, -1},
{ 0, -1},
{ 1, -1},
{-1, 0},
{ 1, 0},
{-1, 1},
{ 0, 1},
{ 1, 1}
};
switch (_opt.landscape) {
case LT_DESERT: TileLoopTreesDesert(tile); break;
case LT_HILLY: TileLoopTreesAlps(tile); break;
@@ -556,7 +545,7 @@ static void TileLoop_Trees(TileIndex tile)
case 2: { /* add a neighbouring tree */
TreeType treetype = GetTreeType(tile);
tile += ToTileIndexDiff(_tileloop_trees_dir[Random() & 7]);
tile += TileOffsByDir(Random() & 7);
if (!IsTileType(tile, MP_CLEAR)) return;