Feature: Hotkey to honk a vehicle's horn (#10110)

This commit is contained in:
Artin Alavi
2022-11-10 12:36:18 -08:00
committed by GitHub
parent 27e1d057c5
commit fd4f148c62
10 changed files with 60 additions and 42 deletions

View File

@@ -2100,7 +2100,7 @@ bool Train::FindClosestDepot(TileIndex *location, DestinationID *destination, bo
}
/** Play a sound for a train leaving the station. */
void Train::PlayLeaveStationSound() const
void Train::PlayLeaveStationSound(bool force) const
{
static const SoundFx sfx[] = {
SND_04_DEPARTURE_STEAM,
@@ -2110,10 +2110,9 @@ void Train::PlayLeaveStationSound() const
SND_41_DEPARTURE_MAGLEV
};
if (PlayVehicleSound(this, VSE_START)) return;
if (PlayVehicleSound(this, VSE_START, force)) return;
EngineID engtype = this->engine_type;
SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], this);
SndPlayVehicleFx(sfx[RailVehInfo(this->engine_type)->engclass], this);
}
/**