mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 00:42:45 +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,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
|
||||
if (rt == ROADTYPE_ROAD && HasTileRoadType(tile, ROADTYPE_TRAM) && (flags & DC_EXEC || crossing_check)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
Track railtrack = GetCrossingRailTrack(tile);
|
||||
RoadTypes rts = GetRoadTypes(tile) & ComplementRoadTypes(RoadTypeToRoadTypes(rt));
|
||||
if (rts == ROADTYPES_NONE) {
|
||||
TrackBits tracks = GetCrossingRailBits(tile);
|
||||
@@ -332,7 +333,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
|
||||
/* If we ever get HWAY and it is possible without road then we will need to promote ownership and invalidate town index here, too */
|
||||
}
|
||||
MarkTileDirtyByTile(tile);
|
||||
YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
|
||||
YapfNotifyTrackLayoutChange(tile, railtrack);
|
||||
}
|
||||
return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_road * 2);
|
||||
}
|
||||
@@ -549,9 +550,10 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile)));
|
||||
Track railtrack = AxisToTrack(OtherAxis(roaddir));
|
||||
YapfNotifyTrackLayoutChange(tile, railtrack);
|
||||
/* Always add road to the roadtypes (can't draw without it) */
|
||||
bool reserved = HasBit(GetTrackReservation(tile), AxisToTrack(OtherAxis(roaddir)));
|
||||
bool reserved = HasBit(GetTrackReservation(tile), railtrack);
|
||||
MakeRoadCrossing(tile, _current_company, _current_company, GetTileOwner(tile), roaddir, GetRailType(tile), RoadTypeToRoadTypes(rt) | ROADTYPES_ROAD, p2);
|
||||
SetCrossingReservation(tile, reserved);
|
||||
UpdateLevelCrossing(tile, false);
|
||||
|
||||
Reference in New Issue
Block a user