train_cmd.c
changeset 2630 7206058a7e82
parent 2618 9691753519ac
child 2634 0df9396b0067
--- a/train_cmd.c	Sat Nov 12 11:10:12 2005 +0000
+++ b/train_cmd.c	Sun Nov 13 13:43:55 2005 +0000
@@ -188,9 +188,10 @@
 	AM_BRAKE
 };
 
-static bool TrainShouldStop(Vehicle *v, TileIndex tile)
+static bool TrainShouldStop(const Vehicle* v, TileIndex tile)
 {
-	Order *o = &v->current_order;
+	const Order* o = &v->current_order;
+
 	assert(v->type == VEH_Train);
 	assert(IsTileType(v->tile, MP_STATION));
 	//When does a train drive through a station
@@ -590,9 +591,9 @@
 }
 
 // Move all free vehicles in the depot to the train
-static void NormalizeTrainVehInDepot(Vehicle *u)
+static void NormalizeTrainVehInDepot(const Vehicle* u)
 {
-	Vehicle *v;
+	const Vehicle* v;
 
 	FOR_ALL_VEHICLES(v) {
 		if (v->type == VEH_Train && v->subtype == TS_Free_Car &&
@@ -624,7 +625,7 @@
 };
 
 
-int32 EstimateTrainCost(const RailVehicleInfo *rvi)
+static int32 EstimateTrainCost(const RailVehicleInfo* rvi)
 {
 	return (rvi->base_cost * (_price.build_railvehicle >> 3)) >> 5;
 }
@@ -1443,7 +1444,7 @@
 	}
 }
 
-TileIndex GetVehicleTileOutOfTunnel(const Vehicle *v, bool reverse)
+static TileIndex GetVehicleTileOutOfTunnel(const Vehicle* v, bool reverse)
 {
 	TileIndex tile;
 	byte direction = (!reverse) ? DirToDiagdir(v->direction) : ReverseDiagdir(v->direction >> 1);
@@ -1859,9 +1860,9 @@
 	1, 1, 1, 0, -1, -1, -1, 0
 };
 
-static void HandleLocomotiveSmokeCloud(Vehicle *v)
+static void HandleLocomotiveSmokeCloud(const Vehicle* v)
 {
-	Vehicle *u;
+	const Vehicle* u;
 
 	if (v->vehstatus & VS_TRAIN_SLOWING || v->load_unload_time_rem != 0 || v->cur_speed < 2)
 		return;
@@ -2054,7 +2055,7 @@
 	}
 }
 
-static void FillWithStationData(TrainTrackFollowerData *fd, Vehicle *v)
+static void FillWithStationData(TrainTrackFollowerData* fd, const Vehicle* v)
 {
         fd->dest_coords = v->dest_tile;
         if (v->current_order.type == OT_GOTO_STATION)
@@ -3535,7 +3536,7 @@
 
 static void CheckIfTrainNeedsService(Vehicle *v)
 {
-	Depot *depot;
+	const Depot* depot;
 	TrainFindDepotData tfdd;
 
 	if (PBSTileReserved(v->tile) & v->u.rail.track)