23 #include "table/industry_land.h" |
23 #include "table/industry_land.h" |
24 #include "table/build_industry.h" |
24 #include "table/build_industry.h" |
25 #include "genworld.h" |
25 #include "genworld.h" |
26 #include "date.h" |
26 #include "date.h" |
27 #include "water_map.h" |
27 #include "water_map.h" |
|
28 #include "tree_map.h" |
28 |
29 |
29 void ShowIndustryViewWindow(int industry); |
30 void ShowIndustryViewWindow(int industry); |
30 void BuildOilRig(TileIndex tile); |
31 void BuildOilRig(TileIndex tile); |
31 |
32 |
32 static byte _industry_sound_ctr; |
33 static byte _industry_sound_ctr; |
863 * @param data that is passed by the caller. In this case, nothing |
864 * @param data that is passed by the caller. In this case, nothing |
864 * @result of the test |
865 * @result of the test |
865 */ |
866 */ |
866 static bool SearchLumberMillTrees(TileIndex tile, uint32 data) |
867 static bool SearchLumberMillTrees(TileIndex tile, uint32 data) |
867 { |
868 { |
868 if (IsTileType(tile, MP_TREES)) { |
869 if (IsTileType(tile, MP_TREES) && GetTreeGrowth(tile) > 2) { ///< 3 and up means all fully grown trees |
869 PlayerID old_player = _current_player; |
870 PlayerID old_player = _current_player; |
870 /* found a tree */ |
871 /* found a tree */ |
871 |
872 |
872 _current_player = OWNER_NONE; |
873 _current_player = OWNER_NONE; |
873 _industry_sound_ctr = 1; |
874 _industry_sound_ctr = 1; |
874 _industry_sound_tile = tile; |
875 _industry_sound_tile = tile; |
875 SndPlayTileFx(SND_38_CHAINSAW, tile); |
876 SndPlayTileFx(SND_38_CHAINSAW, tile); |
876 |
877 |
877 DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); |
878 DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); |
878 SetTropicZone(tile, TROPICZONE_INVALID); |
|
879 |
879 |
880 _current_player = old_player; |
880 _current_player = old_player; |
881 return true; |
881 return true; |
882 } |
882 } |
883 return false; |
883 return false; |