| 232 | } |
| 233 | |
| 234 | static void TileLoopClearDesert(TileIndex tile) |
| 235 | { |
| 236 | /* Current desert level - 0 if it is not desert */ |
| 237 | uint current = 0; |
| 238 | if (IsClearGround(tile, CLEAR_DESERT)) current = GetClearDensity(tile); |
| 239 | |
| 240 | /* Expected desert level - 0 if it shouldn't be desert */ |
| 241 | uint expected = 0; |
| 242 | if (GetTropicZone(tile) == TROPICZONE_DESERT) { |
| 243 | expected = NeighbourIsNormal(tile) ? 1 : 3; |
| 244 | } |
| 245 | |
| 246 | if (current == expected) return; |
| 247 | |
| 248 | if (expected == 0) { |
| 249 | SetClearGroundDensity(tile, CLEAR_GRASS, 3); |
| 250 | } else { |
| 251 | /* Transition from clear to desert is not smooth (after clearing desert tile) */ |
| 252 | SetClearGroundDensity(tile, CLEAR_DESERT, expected); |
| 253 | } |
| 254 | |
| 255 | MarkTileDirtyByTile(tile); |
| 256 | } |
| 257 | |
| 258 | static void TileLoop_Clear(TileIndex tile) |
| 259 | { |
no test coverage detected