# HG changeset patch # User peter1138 # Date 1202895296 0 # Node ID ed21d7485650e2d6924f84f5dbad96c418b534fd # Parent fb5d8378b111ea4751ab5259feddb0fcacfdc61c (svn r12128) -Codechange: Replace last use of TrainPlayLeaveStationSound(v) with v->PlayLeaveStationSound(), and remove wrapper function. diff -r fb5d8378b111 -r ed21d7485650 src/train_cmd.cpp --- a/src/train_cmd.cpp Wed Feb 13 03:21:19 2008 +0000 +++ b/src/train_cmd.cpp Wed Feb 13 09:34:56 2008 +0000 @@ -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;