src/newgrf_commons.cpp
branchNewGRF_ports
changeset 6872 1c4a4a609f85
parent 6871 5a9dc001e1ad
child 6877 889301acc299
--- a/src/newgrf_commons.cpp	Mon Dec 03 23:39:38 2007 +0000
+++ b/src/newgrf_commons.cpp	Tue Jan 22 21:00:30 2008 +0000
@@ -12,6 +12,9 @@
 #include "industry.h"
 #include "newgrf.h"
 #include "newgrf_commons.h"
+#include "tile_map.h"
+#include "station_map.h"
+#include "settings_type.h"
 
 /** Constructor of generic class
  * @param offset end of original data for this entity. i.e: houses = 110
@@ -276,6 +279,9 @@
 	if (x >= 8) x -= 16;
 	if (y >= 8) y -= 16;
 
+	/* Swap width and height depending on axis for railway stations */
+	if (IsRailwayStationTile(tile) && GetRailStationAxis(tile) == AXIS_X) Swap(x, y);
+
 	/* Make sure we never roam outside of the map */
 	return TILE_MASK(tile + TileDiffXY(x, y));
 }