From 3e016e4254c6b8b558c50e7c66bc01ac6d118f4b Mon Sep 17 00:00:00 2001 From: michi_cc Date: Fri, 4 Nov 2011 22:59:23 +0000 Subject: (svn r23116) -Fix (r23114): Ambient sound effect callback was called for unsupported tile types. --- src/tree_cmd.cpp | 5 ++--- src/water_cmd.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index ae3b9bfd2..4ed47900f 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -621,16 +621,15 @@ static void TileLoopTreesAlps(TileIndex tile) static void TileLoop_Trees(TileIndex tile) { if (GetTreeGround(tile) == TREE_GROUND_SHORE) { - TileLoop_Water(tile); // Calls AmbientSoundEffectCallback + TileLoop_Water(tile); } else { switch (_settings_game.game_creation.landscape) { case LT_TROPIC: TileLoopTreesDesert(tile); break; case LT_ARCTIC: TileLoopTreesAlps(tile); break; } - - AmbientSoundEffectCallback(tile); } + AmbientSoundEffectCallback(tile); TileLoopClearHelper(tile); uint treeCounter = GetTreeCounter(tile); diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 18b791b42..bdf142a09 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -1071,7 +1071,7 @@ static void DoDryUp(TileIndex tile) */ void TileLoop_Water(TileIndex tile) { - AmbientSoundEffectCallback(tile); + if (IsTileType(tile, MP_WATER)) AmbientSoundEffectCallback(tile); switch (GetFloodingBehaviour(tile)) { case FLOOD_ACTIVE: -- cgit v1.2.3-54-g00ecf