File tree Expand file tree Collapse file tree
Source/RocketSoundEnhancement Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Unreleased
44
5- - Improve performance when new vessels are created (e.g. during RUD) - thanks @bimo1d
5+ - Improve performance by avoiding reparsing the ShipEffects config when new vessels are created (e.g. during RUD) - thanks @bimo1d
66- Avoid creating ShipEffects VesselModule for debris, spaceobjects, and dropped items - thanks @bimo1d
7+ - Improve performance when vessel part count changes several times in a frame (e.g. during RUD)
8+ - Avoid creating ShipEffects VesselModule for non-loaded vessels
79
810## 0.9.13 - 2026-04-20
911
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ public bool Initialize()
101101
102102 List < Part > asteroidParts = new List < Part > ( ) ;
103103 List < ModuleEngines > engines = new List < ModuleEngines > ( ) ;
104+ bool vesselDataDirty = false ;
104105
105106 void CacheVesselData ( )
106107 {
@@ -121,13 +122,14 @@ void CacheVesselData()
121122 }
122123 }
123124 }
125+ vesselDataDirty = false ;
124126 }
125127
126128 private void OnVesselPartCountChanged ( Vessel data )
127129 {
128130 if ( data != vessel ) return ;
129131
130- CacheVesselData ( ) ;
132+ vesselDataDirty = true ;
131133 }
132134
133135 IEnumerator SetupAudioSources ( List < SoundLayer > soundLayers , bool hasAirSimFilter = true )
@@ -271,6 +273,11 @@ private void LateUpdate()
271273 if ( ! HighLogic . LoadedSceneIsFlight || ! initialized || gamePaused || noPhysics || ignoreVessel )
272274 return ;
273275
276+ if ( vesselDataDirty )
277+ {
278+ CacheVesselData ( ) ;
279+ }
280+
274281 foreach ( var soundLayerGroup in ShipEffectsConfig . SoundLayerGroups )
275282 {
276283 if ( soundLayerGroup . Key == PhysicsControl . SONICBOOM )
You can’t perform that action at this time.
0 commit comments