diff options
author | michi_cc <michi_cc@openttd.org> | 2011-08-20 20:07:02 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-08-20 20:07:02 +0000 |
commit | 4261e8fdfd2c8958fc3cc22e57baa90361051b65 (patch) | |
tree | 5581d098bba7d0fa9d21fae1d9a34e81d698d69e /src/water_cmd.cpp | |
parent | d7baf7a4a9704fe0b797624e3d1e4a2053101aea (diff) | |
download | openttd-4261e8fdfd2c8958fc3cc22e57baa90361051b65.tar.xz |
(svn r22773) -Add: Some grass around rivers in desert areas.
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r-- | src/water_cmd.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 5ac09a9b1..efb3152d1 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -308,6 +308,13 @@ CommandCost CmdBuildLock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 return DoBuildLock(tile, dir, flags); } +/** Callback to create non-desert around a river tile. */ +bool RiverModifyDesertZone(TileIndex tile, void *) +{ + if (GetTropicZone(tile) == TROPICZONE_DESERT) SetTropicZone(tile, TROPICZONE_NORMAL); + return false; +} + /** * Build a piece of canal. * @param tile end tile of stretch-dragging @@ -350,6 +357,10 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 switch (wc) { case WATER_CLASS_RIVER: MakeRiver(tile, Random()); + if (_game_mode == GM_EDITOR) { + TileIndex tile2 = tile; + CircularTileSearch(&tile2, 5, RiverModifyDesertZone, NULL); + } break; case WATER_CLASS_SEA: |