@@ -1420,19 +1420,28 @@ private void SetFreqAndVolume()
1420
1420
volume *= Interpolate ( x , MSTSStream . VolumeCurves [ i ] ) ;
1421
1421
}
1422
1422
1423
- var wag = ( MSTSWagon ) SoundSource . Viewer . Camera . AttachedCar ;
1424
- var soundHeardInternallyCorrection = Math . Min ( wag . SoundHeardInternallyCorrection [ 0 ] + wag . SoundHeardInternallyCorrection [ 1 ] , 1 ) ;
1425
- if ( SoundSource . IsExternal && SoundSource . Viewer . Camera . Style != Camera . Styles . External && ! SoundSource . IsUnattenuated )
1423
+ if ( SoundSource . Viewer . Camera . Style != Camera . Styles . External )
1426
1424
{
1427
- if ( wag == null || wag . ExternalSoundPassThruPercent == - 1 )
1428
- volume *= Program . Viewer . Settings . ExternalSoundPassThruPercent * 0.01f + ( 1 - Program . Viewer . Settings . ExternalSoundPassThruPercent * 0.01f ) * soundHeardInternallyCorrection ;
1429
- else volume *= wag . ExternalSoundPassThruPercent * 0.01f + ( 1 - wag . ExternalSoundPassThruPercent * 0.01f ) * soundHeardInternallyCorrection ;
1425
+ var wag = ( MSTSWagon ) SoundSource . Viewer . Camera . AttachedCar ;
1426
+ var soundHeardInternallyCorrection = Math . Min ( wag . SoundHeardInternallyCorrection [ 0 ] + wag . SoundHeardInternallyCorrection [ 1 ] , 1 ) ;
1427
+ if ( SoundSource . IsExternal && ! SoundSource . IsUnattenuated )
1428
+ {
1429
+ if ( wag == null || wag . ExternalSoundPassThruPercent == - 1 )
1430
+ volume *= Program . Viewer . Settings . ExternalSoundPassThruPercent * 0.01f + ( 1 - Program . Viewer . Settings . ExternalSoundPassThruPercent * 0.01f ) * soundHeardInternallyCorrection ;
1431
+ else volume *= wag . ExternalSoundPassThruPercent * 0.01f + ( 1 - wag . ExternalSoundPassThruPercent * 0.01f ) * soundHeardInternallyCorrection ;
1432
+ }
1433
+
1434
+ if ( SoundSource . IsInternalTrackSound )
1435
+ {
1436
+ if ( wag ? . TrackSoundPassThruPercent != - 1 )
1437
+ volume *= wag . TrackSoundPassThruPercent * 0.01f + ( 1 - wag . TrackSoundPassThruPercent * 0.01f ) * soundHeardInternallyCorrection ;
1438
+ }
1430
1439
}
1431
1440
1432
1441
if ( SoundSource . IsInternalTrackSound && SoundSource . Viewer . Camera . Style != Camera . Styles . External )
1433
1442
{
1434
- if ( wag ? . TrackSoundPassThruPercent != - 1 )
1435
- volume *= wag . TrackSoundPassThruPercent * 0.01f + ( 1 - wag . TrackSoundPassThruPercent * 0.01f ) * soundHeardInternallyCorrection ;
1443
+ if ( ( ( MSTSWagon ) SoundSource . Viewer . Camera . AttachedCar ) ? . TrackSoundPassThruPercent != - 1 )
1444
+ volume *= ( ( MSTSWagon ) SoundSource . Viewer . Camera . AttachedCar ) . TrackSoundPassThruPercent * 0.01f ;
1436
1445
}
1437
1446
1438
1447
ALSoundSource . Volume = volume ;
0 commit comments