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:
13
tree_cmd.c
13
tree_cmd.c
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user