Merge branch 'master' into jgrpp

# Conflicts:
#	src/ai/ai_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/genworld_gui.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/newgrf_sound.cpp
#	src/roadveh.h
#	src/sound.cpp
#	src/station_cmd.cpp
#	src/train.h
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_gui.cpp
This commit is contained in:
Jonathan G Rennison
2022-11-26 23:04:04 +00:00
100 changed files with 1304 additions and 825 deletions

View File

@@ -297,16 +297,10 @@ void Ship::MarkDirty()
this->UpdateCache();
}
static void PlayShipSound(const Vehicle *v)
void Ship::PlayLeaveStationSound(bool force) const
{
if (!PlayVehicleSound(v, VSE_START)) {
SndPlayVehicleFx(ShipVehInfo(v->engine_type)->sfx, v);
}
}
void Ship::PlayLeaveStationSound() const
{
PlayShipSound(this);
if (PlayVehicleSound(this, VSE_START, force)) return;
SndPlayVehicleFx(ShipVehInfo(this->engine_type)->sfx, this);
}
TileIndex Ship::GetOrderStationLocation(StationID station)
@@ -460,7 +454,7 @@ static bool CheckShipLeaveDepot(Ship *v)
v->UpdateViewport(true, true);
SetWindowDirty(WC_VEHICLE_DEPOT, v->tile);
PlayShipSound(v);
v->PlayLeaveStationSound();
VehicleServiceInDepot(v);
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
DirtyVehicleListWindowForVehicle(v);