From 161786e2222b67a48624e82bc9c3aabbc86e51e9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 7 May 2007 15:58:05 +0000 Subject: (svn r9807) -Codechange: unify playing of sound when vehicle has been loaded and leaves the station. --- src/ship_cmd.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ship_cmd.cpp') 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(); -- cgit v1.2.3-54-g00ecf