summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-07-15 16:17:22 +0000
committerfrosch <frosch@openttd.org>2012-07-15 16:17:22 +0000
commitc8cb096533fbb943e455c5e4c2f13ffa2a007c8b (patch)
treedd4c6d34c8d669e772c681f51d59a9c05736bb95 /src/newgrf_station.cpp
parent03b6ad93836c43f9be08468635fa0a914edbfe09 (diff)
downloadopenttd-c8cb096533fbb943e455c5e4c2f13ffa2a007c8b.tar.xz
(svn r24402) -Fix [FS#5243]: Station properties 11 and 14 were combined incorrectly.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 57ff64bdf..cea387879 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -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.
- * @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.
*/
-bool IsStationTileElectrifiable(TileIndex tile)
+bool CanStationTileHavePylons(TileIndex 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)) ||
- !HasBit(statspec->wires, GetStationGfx(tile));
+/**
+ * Check if a rail station tile shall have wires when electrified.
+ * @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. */