diff --git a/docs/landscape.html b/docs/landscape.html
index 55f560254b..a345128ea4 100644
--- a/docs/landscape.html
+++ b/docs/landscape.html
@@ -226,7 +226,7 @@
m1 bits 4..0: owner of the tile
m2: see signals
m3 bits 7..4: see signals
- m8 bits 3..0 = track type:
+ m8 bits 5..0 = track type:
m7 bits 4..0: owner of the road type 0 (normal road)
- m8 bits 3..0: railway track type
+ m8 bits 5..0: railway track type
@@ -978,7 +978,7 @@
m7 bits 4..0: owner of road (road stops)
m7 bits 7..6: present road types (road stops)
m7: animation frame (railway stations/waypoints, airports)
- m8 bits 3..0: track type for railway stations/waypoints
+ m8 bits 5..0: track type for railway stations/waypoints
@@ -1581,7 +1581,7 @@
m7 bits 4..0: owner of road
m7 bit 5 set = on snow or desert
m7 bits 7..6: present road types for road
- m8 bits 3..0: track type for railway
+ m8 bits 5..0: track type for railway
diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html
index 757a574176..b801b334dd 100644
--- a/docs/landscape_grid.html
+++ b/docs/landscape_grid.html
@@ -107,7 +107,7 @@ the array so you can quickly see what is used and what is not.
XXXX XXXX |
OOOO OOOO |
OOOO OOOO |
- OOOO OOOO OOOO XXXX |
+ OOOO OOOO OOXX XXXX |
rail with signals |
@@ -160,7 +160,7 @@ the array so you can quickly see what is used and what is not.
XXXX OOOX |
OOXX XOOO |
XXXX XXXX |
- OOOO OOOO OOOO XXXX |
+ OOOO OOOO OOXX XXXX |
road depot |
@@ -215,7 +215,7 @@ the array so you can quickly see what is used and what is not.
XXXX XXXX |
OOXX XXOO |
XXXX XXXX |
- OOOO OOOO OOOO XXXX |
+ OOOO OOOO OOXX XXXX |
rail waypoint |
@@ -361,7 +361,7 @@ the array so you can quickly see what is used and what is not.
XOOX XXXX |
OOOO OOOO |
XXXX XXXX |
- OOOO OOOO OOOO XXXX |
+ OOOO OOOO OOXX XXXX |
bridge ramp |
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 797ead1f51..768691f080 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -55,7 +55,7 @@ typedef GUIList GUIBridgeList; ///< List of bridges, used in #B
* @param p1 packed start tile coords (~ dx)
* @param p2 various bitstuffed elements
* - p2 = (bit 0- 7) - bridge type (hi bh)
- * - p2 = (bit 8-11) - rail type or road types.
+ * - p2 = (bit 8-13) - rail type or road types.
* - p2 = (bit 15-16) - transport type.
*/
void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2)
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 5bc97a58dc..d21c1468ca 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -166,11 +166,11 @@ RailType AllocateRailType(RailTypeLabel label)
rti->alternate_labels.Clear();
/* Make us compatible with ourself. */
- rti->powered_railtypes = (RailTypes)(1 << rt);
- rti->compatible_railtypes = (RailTypes)(1 << rt);
+ rti->powered_railtypes = (RailTypes)(1LL << rt);
+ rti->compatible_railtypes = (RailTypes)(1LL << rt);
/* We also introduce ourself. */
- rti->introduces_railtypes = (RailTypes)(1 << rt);
+ rti->introduces_railtypes = (RailTypes)(1LL << rt);
/* Default sort order; order of allocation, but with some
* offsets so it's easier for NewGRF to pick a spot without
@@ -441,7 +441,7 @@ static inline bool ValParamTrackOrientation(Track track)
*/
CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- RailType railtype = Extract(p1);
+ RailType railtype = Extract(p1);
Track track = Extract