mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 11:23:21 +00:00
(svn r27252) -Fix [FS#6281]: Invalid infrastructure counting when crossing tram tracks with railroads. (adf88)
This commit is contained in:
parent
0ea4127837
commit
3a82bae0d3
@ -485,31 +485,31 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
RoadTypes roadtypes = GetRoadTypes(tile);
|
||||
RoadBits road = GetRoadBits(tile, ROADTYPE_ROAD);
|
||||
RoadBits tram = GetRoadBits(tile, ROADTYPE_TRAM);
|
||||
switch (roadtypes) {
|
||||
default: break;
|
||||
case ROADTYPES_TRAM:
|
||||
/* Tram crossings must always have road. */
|
||||
if (flags & DC_EXEC) {
|
||||
SetRoadOwner(tile, ROADTYPE_ROAD, _current_company);
|
||||
Company *c = Company::GetIfValid(_current_company);
|
||||
if (c != NULL) {
|
||||
/* A full diagonal tile has two road bits. */
|
||||
c->infrastructure.road[ROADTYPE_ROAD] += 2;
|
||||
DirtyCompanyInfrastructureWindows(c->index);
|
||||
if ((track == TRACK_X && (road | tram) == ROAD_Y) ||
|
||||
(track == TRACK_Y && (road | tram) == ROAD_X)) {
|
||||
switch (roadtypes) {
|
||||
default: break;
|
||||
case ROADTYPES_TRAM:
|
||||
/* Tram crossings must always have road. */
|
||||
if (flags & DC_EXEC) {
|
||||
SetRoadOwner(tile, ROADTYPE_ROAD, _current_company);
|
||||
Company *c = Company::GetIfValid(_current_company);
|
||||
if (c != NULL) {
|
||||
/* A full diagonal tile has two road bits. */
|
||||
c->infrastructure.road[ROADTYPE_ROAD] += 2;
|
||||
DirtyCompanyInfrastructureWindows(c->index);
|
||||
}
|
||||
}
|
||||
}
|
||||
roadtypes |= ROADTYPES_ROAD;
|
||||
break;
|
||||
roadtypes |= ROADTYPES_ROAD;
|
||||
break;
|
||||
|
||||
case ROADTYPES_ALL:
|
||||
if (road != tram) return CMD_ERROR;
|
||||
break;
|
||||
}
|
||||
case ROADTYPES_ALL:
|
||||
if (road != tram) return CMD_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
road |= tram;
|
||||
road |= tram;
|
||||
|
||||
if ((track == TRACK_X && road == ROAD_Y) ||
|
||||
(track == TRACK_Y && road == ROAD_X)) {
|
||||
if (flags & DC_EXEC) {
|
||||
MakeRoadCrossing(tile, GetRoadOwner(tile, ROADTYPE_ROAD), GetRoadOwner(tile, ROADTYPE_TRAM), _current_company, (track == TRACK_X ? AXIS_Y : AXIS_X), railtype, roadtypes, GetTownIndex(tile));
|
||||
UpdateLevelCrossing(tile, false);
|
||||
|
Loading…
Reference in New Issue
Block a user