1
0
Fork 0

(svn r24402) -Fix [FS#5243]: Station properties 11 and 14 were combined incorrectly.

release/1.3
frosch 2012-07-15 16:17:22 +00:00
parent 03b6ad9383
commit c8cb096533
4 changed files with 25 additions and 11 deletions

View File

@ -111,7 +111,6 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
case MP_STATION: case MP_STATION:
if (!HasStationRail(t)) return TRACK_BIT_NONE; if (!HasStationRail(t)) return TRACK_BIT_NONE;
if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE; if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE;
if (!IsStationTileElectrifiable(t)) return TRACK_BIT_NONE;
return TrackToTrackBits(GetRailStationTrack(t)); return TrackToTrackBits(GetRailStationTrack(t));
default: default:
@ -409,7 +408,8 @@ static void DrawCatenaryRailway(const TileInfo *ti)
} }
} }
if (PPPallowed[i] != 0 && HasBit(PCPstatus, i) && !HasBit(OverridePCP, i)) { if (PPPallowed[i] != 0 && HasBit(PCPstatus, i) && !HasBit(OverridePCP, i) &&
(!IsRailStationTile(ti->tile) || CanStationTileHavePylons(ti->tile))) {
for (Direction k = DIR_BEGIN; k < DIR_END; k++) { for (Direction k = DIR_BEGIN; k < DIR_END; k++) {
byte temp = PPPorder[i][GetTLG(ti->tile)][k]; byte temp = PPPorder[i][GetTLG(ti->tile)][k];
@ -443,6 +443,9 @@ static void DrawCatenaryRailway(const TileInfo *ti)
if (height <= GetTileMaxZ(ti->tile) + 1) return; if (height <= GetTileMaxZ(ti->tile) + 1) return;
} }
/* Don't draw a wire if the station tile does not want any */
if (IsRailStationTile(ti->tile) && !CanStationTileHaveWires(ti->tile)) return;
SpriteID wire_normal = GetWireBase(ti->tile); SpriteID wire_normal = GetWireBase(ti->tile);
SpriteID wire_halftile = (halftile_corner != CORNER_INVALID) ? GetWireBase(ti->tile, TCX_UPPER_HALFTILE) : wire_normal; SpriteID wire_halftile = (halftile_corner != CORNER_INVALID) ? GetWireBase(ti->tile, TCX_UPPER_HALFTILE) : wire_normal;
Track halftile_track; Track halftile_track;

View File

@ -895,18 +895,29 @@ bool IsStationTileBlocked(TileIndex tile)
} }
/** /**
* Check if a rail station tile can be electrified. * Check if a rail station tile shall have pylons when electrified.
* @param tile %Tile to test. * @param tile %Tile to test.
* @return Tile can be electrified. * @return Tile shall have pylons.
* @note This could be cached (during build) in the map array to save on all the dereferencing. * @note This could be cached (during build) in the map array to save on all the dereferencing.
*/ */
bool IsStationTileElectrifiable(TileIndex tile) bool CanStationTileHavePylons(TileIndex tile)
{ {
const StationSpec *statspec = GetStationSpec(tile); const StationSpec *statspec = GetStationSpec(tile);
uint gfx = GetStationGfx(tile);
/* Default stations do not draw pylons under roofs (gfx >= 4) */
return statspec != NULL ? HasBit(statspec->pylons, gfx) : gfx < 4;
}
return statspec == NULL || /**
HasBit(statspec->pylons, GetStationGfx(tile)) || * Check if a rail station tile shall have wires when electrified.
!HasBit(statspec->wires, GetStationGfx(tile)); * @param tile %Tile to test.
* @return Tile shall have wires.
* @note This could be cached (during build) in the map array to save on all the dereferencing.
*/
bool CanStationTileHaveWires(TileIndex tile)
{
const StationSpec *statspec = GetStationSpec(tile);
return statspec == NULL || !HasBit(statspec->wires, GetStationGfx(tile));
} }
/** Wrapper for animation control, see #GetStationCallback. */ /** Wrapper for animation control, see #GetStationCallback. */

View File

@ -2774,7 +2774,7 @@ draw_default_foundation:
} }
} }
if (HasStationRail(ti->tile) && HasCatenaryDrawn(GetRailType(ti->tile)) && IsStationTileElectrifiable(ti->tile)) DrawCatenary(ti); if (HasStationRail(ti->tile) && HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
if (HasBit(roadtypes, ROADTYPE_TRAM)) { if (HasBit(roadtypes, ROADTYPE_TRAM)) {
Axis axis = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? AXIS_X : AXIS_Y; Axis axis = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? AXIS_X : AXIS_Y;

View File

@ -39,8 +39,8 @@ void DeleteOilRig(TileIndex t);
/* Check if a rail station tile is traversable. */ /* Check if a rail station tile is traversable. */
bool IsStationTileBlocked(TileIndex tile); bool IsStationTileBlocked(TileIndex tile);
/* Check if a rail station tile is electrifiable. */ bool CanStationTileHavePylons(TileIndex tile);
bool IsStationTileElectrifiable(TileIndex tile); bool CanStationTileHaveWires(TileIndex tile);
void UpdateAirportsNoise(); void UpdateAirportsNoise();