MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / TileLoopTreesDesert

Function TileLoopTreesDesert

src/tree_cmd.cpp:748–773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

746}
747
748static void TileLoopTreesDesert(TileIndex tile)
749{
750 switch (GetTropicZone(tile)) {
751 case TROPICZONE_DESERT:
752 if (GetTreeGround(tile) != TREE_GROUND_SNOW_DESERT) {
753 SetTreeGroundDensity(tile, TREE_GROUND_SNOW_DESERT, 3);
754 MarkTileDirtyByTile(tile);
755 }
756 break;
757
758 case TROPICZONE_RAINFOREST: {
759 static const SoundFx forest_sounds[] = {
760 SND_42_RAINFOREST_1,
761 SND_43_RAINFOREST_2,
762 SND_44_RAINFOREST_3,
763 SND_48_RAINFOREST_4
764 };
765 uint32_t r = Random();
766
767 if (Chance16I(1, 200, r) && _settings_client.sound.ambient) SndPlayTileFx(forest_sounds[GB(r, 16, 2)], tile);
768 break;
769 }
770
771 default: break;
772 }
773}
774
775static void TileLoopTreesAlps(TileIndex tile)
776{

Callers 1

TileLoop_TreesFunction · 0.85

Calls 8

GetTropicZoneFunction · 0.85
GetTreeGroundFunction · 0.85
SetTreeGroundDensityFunction · 0.85
Chance16IFunction · 0.85
SndPlayTileFxFunction · 0.85
GBFunction · 0.85
MarkTileDirtyByTileFunction · 0.70
RandomFunction · 0.50

Tested by

no test coverage detected