Disable vehicle sounds entirely when running headlessly

This commit is contained in:
Jonathan G Rennison
2024-01-23 18:04:41 +00:00
parent f0ec7a7693
commit fa003ebda3

View File

@@ -186,6 +186,7 @@ SoundID GetNewGRFSoundID(const GRFFile *file, SoundID sound_id)
*/ */
bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event, bool force) bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event, bool force)
{ {
if (IsHeadless()) return true;
if ((!_settings_client.sound.vehicle || _settings_client.music.effect_vol == 0) && !force) return true; if ((!_settings_client.sound.vehicle || _settings_client.music.effect_vol == 0) && !force) return true;
const GRFFile *file = v->GetGRF(); const GRFFile *file = v->GetGRF();