mirror of https://github.com/OpenTTD/OpenTTD
(svn r15454) -Fix [FS#2614]: towns did not know about build_on_slopes in some cases, or made decisions on the 'original' slope instead the slope after applying the foundation..
parent
81cf1cac8f
commit
e8dbf62761
|
@ -13,13 +13,14 @@
|
||||||
#include "engine_base.h"
|
#include "engine_base.h"
|
||||||
#include "date_func.h"
|
#include "date_func.h"
|
||||||
#include "settings_type.h"
|
#include "settings_type.h"
|
||||||
|
#include "landscape.h"
|
||||||
|
|
||||||
bool IsPossibleCrossing(const TileIndex tile, Axis ax)
|
bool IsPossibleCrossing(const TileIndex tile, Axis ax)
|
||||||
{
|
{
|
||||||
return (IsTileType(tile, MP_RAILWAY) &&
|
return (IsTileType(tile, MP_RAILWAY) &&
|
||||||
!HasSignals(tile) &&
|
!HasSignals(tile) &&
|
||||||
GetTrackBits(tile) == (ax == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) &&
|
GetTrackBits(tile) == (ax == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) &&
|
||||||
GetTileSlope(tile, NULL) == SLOPE_FLAT);
|
GetFoundationSlope(tile, NULL) == SLOPE_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
|
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
|
||||||
|
|
|
@ -1337,7 +1337,7 @@ static void TileLoop_Road(TileIndex tile)
|
||||||
if (t->road_build_months != 0 &&
|
if (t->road_build_months != 0 &&
|
||||||
(DistanceManhattan(t->xy, tile) < 8 || grp != HZB_TOWN_EDGE) &&
|
(DistanceManhattan(t->xy, tile) < 8 || grp != HZB_TOWN_EDGE) &&
|
||||||
IsNormalRoad(tile) && CountBits(GetAllRoadBits(tile)) > 1 ) {
|
IsNormalRoad(tile) && CountBits(GetAllRoadBits(tile)) > 1 ) {
|
||||||
if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile) && Chance16(1, 40)) {
|
if (GetFoundationSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile) && Chance16(1, 40)) {
|
||||||
StartRoadWorks(tile);
|
StartRoadWorks(tile);
|
||||||
|
|
||||||
SndPlayTileFx(SND_21_JACKHAMMER, tile);
|
SndPlayTileFx(SND_21_JACKHAMMER, tile);
|
||||||
|
|
|
@ -776,7 +776,7 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_slope = GetTileSlope(tile, NULL);
|
cur_slope = _settings_game.construction.build_on_slopes ? GetFoundationSlope(tile, NULL) : GetTileSlope(tile, NULL);
|
||||||
if (cur_slope == SLOPE_FLAT) {
|
if (cur_slope == SLOPE_FLAT) {
|
||||||
no_slope:
|
no_slope:
|
||||||
/* Tile has no slope */
|
/* Tile has no slope */
|
||||||
|
|
Loading…
Reference in New Issue