File diff r10854:9dc46af240e5 → r10855:5a3c2f38f98e
src/tile_map.cpp
Show inline comments
 
@@ -13,14 +13,15 @@
 
 * @param h    If not \c NULL, pointer to storage of z height
 
 * @return Slope of the tile, except for the HALFTILE part */
 
Slope GetTileSlope(TileIndex tile, uint *h)
 
{
 
	assert(tile < MapSize());
 

	
 
	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
 
		if (h != NULL) *h = 0;
 
	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY() ||
 
			(_settings_game.construction.freeform_edges && (TileX(tile) == 0 || TileY(tile) == 0))) {
 
		if (h != NULL) *h = TileHeight(tile) * TILE_HEIGHT;
 
		return SLOPE_FLAT;
 
	}
 

	
 
	uint a = TileHeight(tile); // Height of the N corner
 
	uint min = a; // Minimal height of all corners examined so far
 
	uint b = TileHeight(tile + TileDiffXY(1, 0)); // Height of the W corner