changeset 8550:14ecde7f8abf draft

(svn r12128) -Codechange: Replace last use of TrainPlayLeaveStationSound(v) with v->PlayLeaveStationSound(), and remove wrapper function.
author peter1138 <peter1138@openttd.org>
date Wed, 13 Feb 2008 09:34:56 +0000
parents 24eb7d2b8315
children bfe75aee55ee
files src/train_cmd.cpp
diffstat 1 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2202,7 +2202,7 @@
 	if (sound) PlayVehicleSound(u, VSE_TRAIN_EFFECT);
 }
 
-static void TrainPlayLeaveStationSound(const Vehicle* v)
+void Train::PlayLeaveStationSound() const
 {
 	static const SoundFx sfx[] = {
 		SND_04_TRAIN,
@@ -2212,15 +2212,10 @@
 		SND_41_MAGLEV
 	};
 
-	if (PlayVehicleSound(v, VSE_START)) return;
-
-	EngineID engtype = v->engine_type;
-	SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v);
-}
-
-void Train::PlayLeaveStationSound() const
-{
-	TrainPlayLeaveStationSound(this);
+	if (PlayVehicleSound(this, VSE_START)) return;
+
+	EngineID engtype = this->engine_type;
+	SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], this);
 }
 
 static bool CheckTrainStayInDepot(Vehicle *v)
@@ -2253,7 +2248,7 @@
 
 	VehicleServiceInDepot(v);
 	InvalidateWindowClasses(WC_TRAINS_LIST);
-	TrainPlayLeaveStationSound(v);
+	v->PlayLeaveStationSound();
 
 	v->u.rail.track = TRACK_BIT_X;
 	if (v->direction & 2) v->u.rail.track = TRACK_BIT_Y;