diff options
author | rubidium <rubidium@openttd.org> | 2007-05-07 15:58:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-07 15:58:05 +0000 |
commit | 161786e2222b67a48624e82bc9c3aabbc86e51e9 (patch) | |
tree | ae24499f9e5c82cb54457487b656bef2c2b5055a /src/ship_cmd.cpp | |
parent | 4591fb5b0d7f9ade45093a86d6a7150c80414dc5 (diff) | |
download | openttd-161786e2222b67a48624e82bc9c3aabbc86e51e9.tar.xz |
(svn r9807) -Codechange: unify playing of sound when vehicle has been loaded and leaves the station.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index c3ddb5226..aeda55d0d 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -235,13 +235,18 @@ void Ship::MarkDirty() MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1); } -static void PlayShipSound(Vehicle *v) +static void PlayShipSound(const Vehicle *v) { if (!PlayVehicleSound(v, VSE_START)) { SndPlayVehicleFx(ShipVehInfo(v->engine_type)->sfx, v); } } +void Ship::PlayLeaveStationSound() const +{ + PlayShipSound(this); +} + static void ProcessShipOrder(Vehicle *v) { const Order *order; @@ -308,7 +313,7 @@ static void HandleShipLoading(Vehicle *v) if (LoadUnloadVehicle(v)) return; - PlayShipSound(v); + v->PlayLeaveStationSound(); Order b = v->current_order; v->LeaveStation(); |