mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 03:12:41 +00:00
(svn r18477) [0.7] -Backport from trunk:
- Fix: On slopes the original and better road layouts did not check their minimum distance requirements [FS#3332] (r18415) - Fix: Aqueducts were not influenced by the "long bridges" setting [FS#3338] (r18407) - Fix: Drive through road stops did not get flooded (r18401) - Fix: [YAPP] Trains on bridges were not found, when searching for the origin of a reservation [FS#3345] (r18392)
This commit is contained in:
parent
fd89332101
commit
ff67ed58da
@ -233,7 +233,9 @@ static Vehicle *FindTrainOnTrackEnum(Vehicle *v, void *data)
|
||||
{
|
||||
FindTrainOnTrackInfo *info = (FindTrainOnTrackInfo *)data;
|
||||
|
||||
if (v->type == VEH_TRAIN && !(v->vehstatus & VS_CRASHED) && HasBit((TrackBits)v->u.rail.track, TrackdirToTrack(info->res.trackdir))) {
|
||||
if (v->type != VEH_TRAIN || (v->vehstatus & VS_CRASHED)) return NULL;
|
||||
|
||||
if (v->u.rail.track == TRACK_BIT_WORMHOLE || HasBit((TrackBits)v->u.rail.track, TrackdirToTrack(info->res.trackdir))) {
|
||||
v = v->First();
|
||||
|
||||
/* ALWAYS return the lowest ID (anti-desync!) */
|
||||
|
@ -3154,6 +3154,9 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o
|
||||
*/
|
||||
static bool CanRemoveRoadWithStop(TileIndex tile, DoCommandFlag flags)
|
||||
{
|
||||
/* Yeah... water can always remove stops, right? */
|
||||
if (_current_company == OWNER_WATER) return true;
|
||||
|
||||
Owner road_owner = _current_company;
|
||||
Owner tram_owner = _current_company;
|
||||
|
||||
|
@ -760,19 +760,8 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir)
|
||||
}
|
||||
|
||||
cur_slope = _settings_game.construction.build_on_slopes ? GetFoundationSlope(tile, NULL) : GetTileSlope(tile, NULL);
|
||||
if (cur_slope == SLOPE_FLAT) {
|
||||
no_slope:
|
||||
/* Tile has no slope */
|
||||
switch (t->layout) {
|
||||
default: NOT_REACHED();
|
||||
|
||||
case TL_ORIGINAL: // Disallow the road if any neighboring tile has a road (distance: 1)
|
||||
return !IsNeighborRoadTile(tile, dir, 1);
|
||||
|
||||
case TL_BETTER_ROADS: // Disallow the road if any neighboring tile has a road (distance: 1 and 2).
|
||||
return !IsNeighborRoadTile(tile, dir, 2);
|
||||
}
|
||||
}
|
||||
bool ret = !IsNeighborRoadTile(tile, dir, t->layout == TL_ORIGINAL ? 1 : 2);
|
||||
if (cur_slope == SLOPE_FLAT) return ret;
|
||||
|
||||
/* If the tile is not a slope in the right direction, then
|
||||
* maybe terraform some. */
|
||||
@ -787,12 +776,12 @@ no_slope:
|
||||
}
|
||||
if (CmdFailed(res) && Chance16(1, 3)) {
|
||||
/* We can consider building on the slope, though. */
|
||||
goto no_slope;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,6 +248,8 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
|
||||
if (transport_type != TRANSPORT_WATER) {
|
||||
/* set and test bridge length, availability */
|
||||
if (!CheckBridge_Stuff(bridge_type, bridge_len, flags)) return_cmd_error(STR_5015_CAN_T_BUILD_BRIDGE_HERE);
|
||||
} else {
|
||||
if (bridge_len > (_settings_game.construction.longbridges ? 100U : 16U)) return_cmd_error(STR_5015_CAN_T_BUILD_BRIDGE_HERE);
|
||||
}
|
||||
|
||||
/* retrieve landscape height and ensure it's on land */
|
||||
|
Loading…
Reference in New Issue
Block a user