(svn r8899) -Fix
authortron
Sun, 25 Feb 2007 11:36:19 +0000
changeset 6154 8f4c65bdf930
parent 6153 eb35b73b300a
child 6155 38e464212f4a
(svn r8899) -Fix

Remove the unused second parameter from GetTileRailType()
src/npf.cpp
src/rail.cpp
src/rail_map.h
src/train_cmd.cpp
src/yapf/follow_track.hpp
src/yapf/yapf_costrail.hpp
--- a/src/npf.cpp	Sun Feb 25 10:49:13 2007 +0000
+++ b/src/npf.cpp	Sun Feb 25 11:36:19 2007 +0000
@@ -594,7 +594,7 @@
 
 	/* check correct rail type (mono, maglev, etc) */
 	if (type == TRANSPORT_RAIL) {
-		RailType dst_type = GetTileRailType(dst_tile, TrackdirToTrack(src_trackdir));
+		RailType dst_type = GetTileRailType(dst_tile);
 		if (!HASBIT(aystar->user_data[NPF_RAILTYPES], dst_type))
 			return;
 	}
--- a/src/rail.cpp	Sun Feb 25 10:49:13 2007 +0000
+++ b/src/rail.cpp	Sun Feb 25 11:36:19 2007 +0000
@@ -102,7 +102,7 @@
 };
 
 
-RailType GetTileRailType(TileIndex tile, Track track)
+RailType GetTileRailType(TileIndex tile)
 {
 	switch (GetTileType(tile)) {
 		case MP_RAILWAY:
--- a/src/rail_map.h	Sun Feb 25 10:49:13 2007 +0000
+++ b/src/rail_map.h	Sun Feb 25 11:36:19 2007 +0000
@@ -261,12 +261,8 @@
 
 /**
  * Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
- * Note that there is no check if the given trackdir is actually present on
- * the tile!
- * The given trackdir is used when there are (could be) multiple rail types on
- * one tile.
  */
-RailType GetTileRailType(TileIndex tile, Track track);
+RailType GetTileRailType(TileIndex tile);
 
 
 typedef enum RailGroundType {
--- a/src/train_cmd.cpp	Sun Feb 25 10:49:13 2007 +0000
+++ b/src/train_cmd.cpp	Sun Feb 25 11:36:19 2007 +0000
@@ -2012,7 +2012,7 @@
 		if (IsTileDepotType(v->tile, TRANSPORT_RAIL) || IsTunnelTile(v->tile)) continue;
 
 		// No sparks for electric vehicles on nonelectrified tracks
-		if (!HasPowerOnRail(v->u.rail.railtype, GetTileRailType(v->tile, TrackdirToTrack(GetVehicleTrackdir(v))))) continue;
+		if (!HasPowerOnRail(v->u.rail.railtype, GetTileRailType(v->tile))) continue;
 
 		if (effect_type == 0) {
 			// Use default effect type for engine class.
@@ -3019,7 +3019,7 @@
 				if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) {
 					v->tile = gp.new_tile;
 
-					if (GetTileRailType(gp.new_tile, FindFirstTrack(chosen_track)) != GetTileRailType(gp.old_tile, FindFirstTrack(v->u.rail.track))) {
+					if (GetTileRailType(gp.new_tile) != GetTileRailType(gp.old_tile)) {
 						TrainPowerChanged(GetFirstVehicleInChain(v));
 					}
 
--- a/src/yapf/follow_track.hpp	Sun Feb 25 10:49:13 2007 +0000
+++ b/src/yapf/follow_track.hpp	Sun Feb 25 11:36:19 2007 +0000
@@ -173,7 +173,7 @@
 
 		// rail transport is possible only on compatible rail types
 		if (IsRailTT()) {
-			RailType rail_type = GetTileRailType(m_new_tile, TrackdirToTrack(DiagdirToDiagTrackdir(m_exitdir)));
+			RailType rail_type = GetTileRailType(m_new_tile);
 			if (!HASBIT(m_veh->u.rail.compatible_railtypes, rail_type)) {
 				// incompatible rail type
 				return false;
--- a/src/yapf/yapf_costrail.hpp	Sun Feb 25 10:49:13 2007 +0000
+++ b/src/yapf/yapf_costrail.hpp	Sun Feb 25 11:36:19 2007 +0000
@@ -192,7 +192,7 @@
 		Trackdir trackdir = n.m_key.m_td;
 		TileType tile_type = GetTileType(tile);
 
-		RailType rail_type = GetTileRailType(tile, TrackdirToTrack(trackdir));
+		RailType rail_type = GetTileRailType(tile);
 
 		bool target_seen = Yapf().PfDetectDestination(tile, trackdir);
 
@@ -254,7 +254,7 @@
 
 			// if tail type changes, finish segment (cached segment can't contain more rail types)
 			{
-				RailType new_rail_type = GetTileRailType(F.m_new_tile, TrackdirToTrack(FindFirstTrackdir(F.m_new_td_bits)));
+				RailType new_rail_type = GetTileRailType(F.m_new_tile);
 				if (new_rail_type != rail_type) {
 					break;
 				}