# autoslope.h File Reference

`#include "depot.h"`
`#include "settings_type.h"`
`#include "player_func.h"`

Go to the source code of this file.

## Functions
static bool | AutoslopeCheckForEntranceEdge (TileIndex tile, uint z_new, Slope tileh_new, DiagDirection entrance)
| Autoslope check for tiles with an entrance on an edge.
static bool | AutoslopeEnabled ()
| Tests if autoslope is enabled for _current_player.

## Detailed Description

Definition in file autoslope.h.

## Function Documentation

static bool AutoslopeCheckForEntranceEdge | ( | TileIndex | tile,
|  | uint | z_new,
|  | Slope | tileh_new,
|  | DiagDirection | entrance |
| ) |  |  | `[inline, static]`

Autoslope check for tiles with an entrance on an edge.

E.g. depots and non-drive-through-road-stops.

The test succeeds if the slope is not steep and at least one corner of the entrance edge is on the TileMaxZ() level.

Note:
  The test does not check if autoslope is enabled at all.

Parameters:

  | tile | The tile.
  | z_new | New TileZ.
  | tileh_new | New TileSlope.
  | entrance | Entrance edge.

Returns:
  true iff terraforming is allowed.

Definition at line 26 of file autoslope.h.

References CanBuildDepotByTileh(), GetSlopeMaxZ(), IsSteepSlope(), and SLOPE_FLAT.

static bool AutoslopeEnabled | ( |  | ) | `[inline, static]`

Tests if autoslope is enabled for _current_player.

Autoslope is disabled for town/industry construction and old ai players.

Returns:
  true iff autoslope is enabled.

Definition at line 39 of file autoslope.h.

References OWNER_NONE.

Referenced by TestAutoslopeOnRailTile().