(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
authorcelestar
Wed, 29 Mar 2006 19:37:18 +0000
changeset 3360 edef9ad64773
parent 3359 d4316b1af327
child 3361 47e190d820e0
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
station.h
station_map.h
--- a/station.h	Wed Mar 29 19:03:47 2006 +0000
+++ b/station.h	Wed Mar 29 19:37:18 2006 +0000
@@ -194,11 +194,6 @@
 void StationPickerDrawSprite(int x, int y, RailType railtype, int image);
 
 RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type);
-static inline RoadStopType GetRoadStopType(TileIndex tile)
-{
-	return (_m[tile].m5 < 0x47) ? RS_TRUCK : RS_BUS;
-}
-
 RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type);
 uint GetNumRoadStops(const Station* st, RoadStopType type);
 RoadStop * AllocateRoadStop( void );
--- a/station_map.h	Wed Mar 29 19:03:47 2006 +0000
+++ b/station_map.h	Wed Mar 29 19:37:18 2006 +0000
@@ -60,6 +60,12 @@
 
 StationType GetStationType(TileIndex);
 
+static inline RoadStopType GetRoadStopType(TileIndex t)
+{
+	assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
+	return GetStationType(t) == STATION_TRUCK ? RS_TRUCK : RS_BUS;
+}
+
 static inline bool IsRailwayStation(TileIndex t)
 {
 	return _m[t].m5 < RAILWAY_BASE + RAILWAY_SIZE;