summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-02-13 09:34:56 +0000
committerpeter1138 <peter1138@openttd.org>2008-02-13 09:34:56 +0000
commit3abf3e3fa4a1b5327a92a34e9cb0b82c0e7032cd (patch)
tree8b1f9d027e4ab21a89723c0f0c6e9dc872ac70f1
parentf24e231e9a3b41ccc230fd4c5a5d00c74064b824 (diff)
downloadopenttd-3abf3e3fa4a1b5327a92a34e9cb0b82c0e7032cd.tar.xz
(svn r12128) -Codechange: Replace last use of TrainPlayLeaveStationSound(v) with v->PlayLeaveStationSound(), and remove wrapper function.
-rw-r--r--src/train_cmd.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index db7a4fe9d..110427547 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2202,7 +2202,7 @@ static void HandleLocomotiveSmokeCloud(const Vehicle* v)
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 @@ static void TrainPlayLeaveStationSound(const Vehicle* v)
SND_41_MAGLEV
};
- if (PlayVehicleSound(v, VSE_START)) return;
-
- EngineID engtype = v->engine_type;
- SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v);
-}
+ if (PlayVehicleSound(this, VSE_START)) return;
-void Train::PlayLeaveStationSound() const
-{
- TrainPlayLeaveStationSound(this);
+ EngineID engtype = this->engine_type;
+ SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], this);
}
static bool CheckTrainStayInDepot(Vehicle *v)
@@ -2253,7 +2248,7 @@ static bool CheckTrainStayInDepot(Vehicle *v)
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;