summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-07 15:58:05 +0000
committerrubidium <rubidium@openttd.org>2007-05-07 15:58:05 +0000
commit161786e2222b67a48624e82bc9c3aabbc86e51e9 (patch)
treeae24499f9e5c82cb54457487b656bef2c2b5055a /src/train_cmd.cpp
parent4591fb5b0d7f9ade45093a86d6a7150c80414dc5 (diff)
downloadopenttd-161786e2222b67a48624e82bc9c3aabbc86e51e9.tar.xz
(svn r9807) -Codechange: unify playing of sound when vehicle has been loaded and leaves the station.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 71cdccdd6..a28f862a6 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2097,6 +2097,11 @@ static void TrainPlayLeaveStationSound(const Vehicle* v)
SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v);
}
+void Train::PlayLeaveStationSound() const
+{
+ TrainPlayLeaveStationSound(this);
+}
+
static bool CheckTrainStayInDepot(Vehicle *v)
{
/* bail out if not all wagons are in the same depot or not in a depot at all */
@@ -2531,7 +2536,7 @@ static void HandleTrainLoading(Vehicle *v, bool mode)
if (LoadUnloadVehicle(v)) return;
- TrainPlayLeaveStationSound(v);
+ v->PlayLeaveStationSound();
Order b = v->current_order;
v->LeaveStation();