Repository navigation
EAC v1.2.0
Crash Detection Fix
HandleRecovery() in CrashSeverity.cs was triggering crash-injury rolls on clean vessel recoveries. KSP fires onCrash and onCrashSplashdown internally during the recovery sequence regardless of damage, which was being misread as evidence of a real crash. The guard condition now requires at least one of: actual part destruction (EstimatedLostParts > 0), an explosion event (ExplosionEvents > 0), or crew fatalities. ImpactEvents and SawCrashEvent continue to influence injury severity when a real crash is confirmed, but can no longer trigger the system on their own.
Startup Lag Fixes
Profiling (via instrumented build with Stopwatch timing on all startup phases) confirmed that EAC's explicit Start() code completes in under 250ms on both lightly and heavily modded installs. The lag was traced to three post-startup sources:
Hall of History save file parse. HallOfHistoryWindow.Start() called ForceRefresh() which synchronously parsed persistent.sfs via ConfigNode.Load(). The fix defers this load until the Hall of History window is actually opened. The Update() poll is initialized to float.MaxValue to prevent any background polling before first open, and is re-armed in ShowWindowInternal() on first use.
Full-scene transform scan for AC tab setup. AstronautComplexRetiredTab uses Resources.FindObjectsOfTypeAll<Transform>() to locate the Tabs and VesselScrollRect roots in the Astronaut Complex UI. This API returns every Transform in the scene including inactive prefabs — in a heavily modded install this is thousands of objects and takes 1–3+ seconds. The fix adds a fast path to both FindTabsRoot() and FindVesselScrollRect(): first find the AstronautComplex MonoBehaviour using a type-specific lookup (returns 1–2 objects), then search only within that hierarchy using the new FindInHierarchy() depth-first helper. The original full-scene scan is kept as a fallback. SetupWorker timing and DoSetupTick() logic are otherwise unchanged.
Redundant Assembly-CSharp type scans. Three hooks independently called assembly.GetTypes() at startup; AstronautComplexHook called it twice. The new KspAssemblyCache class caches the result of the first call and shares it across all hooks.
Testing Notes
- Retired tab and Lost tab appear correctly in the Astronaut Complex regardless of how quickly the AC is opened after scene load.
- Clean vessel recovery no longer triggers crash-injury rolls.
- Real crashes (parts destroyed, explosions, fatalities) continue to trigger crash-injury processing normally.
- Hall of History window loads correctly on first open; periodic save-file change detection continues to work after that.