summaryrefslogtreecommitdiff
path: root/src/elrail.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-20 16:50:48 +0000
committerrubidium <rubidium@openttd.org>2007-10-20 16:50:48 +0000
commit99266a173ce8d5bf9bf1bb85e3b58be296430865 (patch)
tree30e50cebc542be694f72726e770ef47ea943f6d0 /src/elrail.cpp
parenteadd6765e139d452ab11a5785b1761901a1932aa (diff)
downloadopenttd-99266a173ce8d5bf9bf1bb85e3b58be296430865.tar.xz
(svn r11313) -Codechange: prepare several pieces of code so the can handle some new slopes. Patch by frosch.
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r--src/elrail.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index bb0f6eb1f..8a0e7854c 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -213,6 +213,10 @@ static void DrawCatenaryRailway(const TileInfo *ti)
/* Note that ti->tileh has already been adjusted for Foundations */
Slope tileh[TS_END] = { ti->tileh, SLOPE_FLAT };
+ /* Half tile slopes coincide only with horizontal/vertical track.
+ * Faking a flat slope results in the correct sprites on positions. */
+ if (IsHalftileSlope(tileh[TS_HOME])) tileh[TS_HOME] = SLOPE_FLAT;
+
TLG tlg = GetTLG(ti->tile);
byte PCPstatus = 0;
byte OverridePCP = 0;
@@ -291,6 +295,10 @@ static void DrawCatenaryRailway(const TileInfo *ti)
ApplyFoundationToSlope(foundation, &tileh[TS_NEIGHBOUR]);
+ /* Half tile slopes coincide only with horizontal/vertical track.
+ * Faking a flat slope results in the correct sprites on positions. */
+ if (IsHalftileSlope(tileh[TS_NEIGHBOUR])) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
+
AdjustTileh(neighbour, &tileh[TS_NEIGHBOUR]);
/* If we have a straight (and level) track, we want a pylon only every 2 tiles