clear_cmd.c
changeset 3379 ea8aa9e71328
parent 3310 7339b2b1e957
child 3418 a592d40a4d04
equal deleted inserted replaced
3378:6f5846e508e0 3379:ea8aa9e71328
   601 
   601 
   602 static void TileLoopClearDesert(TileIndex tile)
   602 static void TileLoopClearDesert(TileIndex tile)
   603 {
   603 {
   604 	if (IsClearGround(tile, CL_DESERT)) return;
   604 	if (IsClearGround(tile, CL_DESERT)) return;
   605 
   605 
   606 	if (GetMapExtraBits(tile) == 1) {
   606 	if (GetTropicZone(tile) == TROPICZONE_DESERT) {
   607 		SetClearGroundDensity(tile, CL_DESERT, 3);
   607 		SetClearGroundDensity(tile, CL_DESERT, 3);
   608 	} else {
   608 	} else {
   609 		if (GetMapExtraBits(tile + TileDiffXY( 1,  0)) != 1 &&
   609 		if (GetTropicZone(tile + TileDiffXY( 1,  0)) != TROPICZONE_DESERT &&
   610 				GetMapExtraBits(tile + TileDiffXY(-1,  0)) != 1 &&
   610 				GetTropicZone(tile + TileDiffXY(-1,  0)) != TROPICZONE_DESERT &&
   611 				GetMapExtraBits(tile + TileDiffXY( 0,  1)) != 1 &&
   611 				GetTropicZone(tile + TileDiffXY( 0,  1)) != TROPICZONE_DESERT &&
   612 				GetMapExtraBits(tile + TileDiffXY( 0, -1)) != 1)
   612 				GetTropicZone(tile + TileDiffXY( 0, -1)) != TROPICZONE_DESERT)
   613 			return;
   613 			return;
   614 		SetClearGroundDensity(tile, CL_DESERT, 1);
   614 		SetClearGroundDensity(tile, CL_DESERT, 1);
   615 	}
   615 	}
   616 
   616 
   617 	MarkTileDirtyByTile(tile);
   617 	MarkTileDirtyByTile(tile);