mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-15 16:32:41 +01:00
(svn r16324) [0.7] -Backport from trunk:
- Fix: Desyncs due to the fact that depot searching with a maximum search depth simply does not work with YAPF's caches [FS#2900] (r16323) - Fix: Trains could get stuck in a depot when they wanted to go to the same depot again [FS#2873] (r16322) - Fix: In the scenario editor change the (starting) game year of the scenario, not the (starting) game year for new games/scenarios (r16321) - Fix: Loading of savegames created in revision between 0.3.5 and 0.3.6 caused crash (r16320) - Fix: [NoAI] Set the autorenew settings for new AI companies to the default values, not to 0 or the local settings (r16316) - Fix: [NewGRF] Allow accessing the house age when the house is not yet built (r16314) - Fix: (Get|Set)TrackBits() is only valid for RAIL_TILE_NORMAL and _SIGNALS (r16311)
This commit is contained in:
@@ -321,6 +321,8 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
case MP_RAILWAY:
|
||||
if (!CheckTileOwnership(tile)) return CMD_ERROR;
|
||||
|
||||
if (!IsPlainRailTile(tile)) return CMD_ERROR;
|
||||
|
||||
if (!IsCompatibleRail(GetRailType(tile), railtype)) return_cmd_error(STR_1001_IMPOSSIBLE_TRACK_COMBINATION);
|
||||
|
||||
if (!CheckTrackCombination(tile, trackbit, flags) ||
|
||||
@@ -554,6 +556,8 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
*/
|
||||
bool FloodHalftile(TileIndex t)
|
||||
{
|
||||
assert(IsPlainRailTile(t));
|
||||
|
||||
bool flooded = false;
|
||||
if (GetRailGroundType(t) == RAIL_GROUND_WATER) return flooded;
|
||||
|
||||
@@ -1043,7 +1047,7 @@ static CommandCost CmdSignalTrackHelper(TileIndex tile, DoCommandFlag flags, uin
|
||||
end_tile = p1;
|
||||
if (signal_density == 0 || signal_density > 20) return CMD_ERROR;
|
||||
|
||||
if (!IsTileType(tile, MP_RAILWAY)) return CMD_ERROR;
|
||||
if (!IsTileType(tile, MP_RAILWAY) || !IsPlainRailTile(tile)) return CMD_ERROR;
|
||||
|
||||
/* for vertical/horizontal tracks, double the given signals density
|
||||
* since the original amount will be too dense (shorter tracks) */
|
||||
@@ -1169,6 +1173,7 @@ CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1
|
||||
|
||||
if (!ValParamTrackOrientation(track) ||
|
||||
!IsTileType(tile, MP_RAILWAY) ||
|
||||
!IsPlainRailTile(tile) ||
|
||||
!HasTrack(tile, track) ||
|
||||
!EnsureNoTrainOnTrack(tile, track) ||
|
||||
!HasSignalOnTrack(tile, track)) {
|
||||
@@ -2175,7 +2180,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_X)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(0, -1);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
@@ -2190,7 +2195,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_X)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(0, 1);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
@@ -2206,7 +2211,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_Y)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(-1, 0);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
@@ -2221,7 +2226,7 @@ static void TileLoop_Track(TileIndex tile)
|
||||
(rail & TRACK_BIT_Y)
|
||||
)) {
|
||||
TileIndex n = tile + TileDiffXY(1, 0);
|
||||
TrackBits nrail = GetTrackBits(n);
|
||||
TrackBits nrail = (IsTileType(n, MP_RAILWAY) && IsPlainRailTile(n) ? GetTrackBits(n) : TRACK_BIT_NONE);
|
||||
|
||||
if (!IsTileType(n, MP_RAILWAY) ||
|
||||
!IsTileOwner(n, owner) ||
|
||||
|
||||
Reference in New Issue
Block a user