diff --git a/Plugin/KethaneData.cs b/Plugin/KethaneData.cs index 9a674d4..527c351 100644 --- a/Plugin/KethaneData.cs +++ b/Plugin/KethaneData.cs @@ -34,11 +34,6 @@ public static KethaneData Current private Dictionary generatorNodes = new Dictionary(); private Dictionary generators = new Dictionary(); - public ICellResource GetDepositUnder(string resourceName, Vessel vessel) - { - return GetCellDeposit(resourceName, vessel.mainBody, MapOverlay.GetCellUnder(vessel.mainBody, vessel.transform.position)); - } - public ICellResource GetCellDeposit(string resourceName, CelestialBody body, Cell cell) { if (resourceName == null || body == null || !PlanetDeposits.ContainsKey(resourceName) || !PlanetDeposits[resourceName].ContainsKey(body.name)) { return null; } diff --git a/Plugin/PartModules/KethaneExtractor.cs b/Plugin/PartModules/KethaneExtractor.cs index ba30f60..d847ce7 100644 --- a/Plugin/PartModules/KethaneExtractor.cs +++ b/Plugin/PartModules/KethaneExtractor.cs @@ -182,7 +182,7 @@ public void Update() { if (animator.CurrentState == ExtractorState.Deployed) { - emitter.Emit = hit && KethaneData.Current.GetDepositUnder("Kethane", this.vessel) != null; + emitter.Emit = hit && GetDepositUnder("Kethane") != null; } else { @@ -209,7 +209,7 @@ public override void OnFixedUpdate() foreach (var resource in resources) { - var deposit = KethaneData.Current.GetDepositUnder(resource.Name, this.vessel); + var deposit = GetDepositUnder(resource.Name); if (deposit == null) { continue; } double amount = TimeWarp.fixedDeltaTime * resource.Rate * energyRatio; @@ -218,6 +218,11 @@ public override void OnFixedUpdate() } } + private ICellResource GetDepositUnder(string resourceName) + { + return KethaneData.Current.GetCellDeposit(resourceName, this.vessel.mainBody, MapOverlay.GetCellUnder(this.vessel.mainBody, this.vessel.transform.position)); + } + private bool raycastGround() { RaycastHit hitInfo;