(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums

This commit is contained in:
tron
2006-04-23 13:48:16 +00:00
parent fa213c686e
commit dd180a1e18
28 changed files with 339 additions and 292 deletions

View File

@@ -174,7 +174,7 @@ void UpdateAllWaypointCustomGraphics(void)
int32 CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Waypoint *wp;
uint tileh;
Slope tileh;
Axis axis;
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
@@ -196,8 +196,8 @@ int32 CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
tileh = GetTileSlope(tile, NULL);
if (tileh != 0) {
if (!_patches.build_on_slopes || IsSteepTileh(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
if (tileh != SLOPE_FLAT) {
if (!_patches.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
}