autoslope.h File Reference

Functions related to autoslope. More...

#include "company_func.h"
#include "depot_func.h"
#include "tile_map.h"

Go to the source code of this file.


static bool AutoslopeCheckForEntranceEdge (TileIndex tile, int z_new, Slope tileh_new, DiagDirection entrance)
 Autoslope check for tiles with an entrance on an edge. More...
static bool AutoslopeEnabled ()
 Tests if autoslope is enabled for _current_company. More...

Detailed Description

Functions related to autoslope.

Definition in file autoslope.h.

Function Documentation

◆ AutoslopeCheckForEntranceEdge()

static bool AutoslopeCheckForEntranceEdge ( TileIndex  tile,
int  z_new,
Slope  tileh_new,
DiagDirection  entrance 

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.

The test does not check if autoslope is enabled at all.
tileThe tile.
z_newNew TileZ.
tileh_newNew TileSlope.
entranceEntrance edge.
true iff terraforming is allowed.

Definition at line 33 of file autoslope.h.

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

◆ AutoslopeEnabled()

static bool AutoslopeEnabled ( )

Tests if autoslope is enabled for _current_company.

Autoslope is disabled for town/industry construction.

true iff autoslope is enabled.

Definition at line 46 of file autoslope.h.

References _current_company, _settings_game, ConstructionSettings::autoslope, GameSettings::construction, MAX_COMPANIES, and OWNER_NONE.

Referenced by TestAutoslopeOnRailTile().