Skip to content

Commit

Permalink
Eliminate PartModules dependency on EnumerableExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 4, 2014
1 parent 800e062 commit 3df9e5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Plugin/PartModules/KethaneConverter.cs
@@ -1,5 +1,4 @@
using Kethane.EnumerableExtensions;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -188,7 +187,7 @@ public override void OnFixedUpdate()
if (!IsEnabled && !AlwaysActive) { return; }

var rates = outputRates.Select(r => r * -1).Concat(inputRates).Select(r => r * TimeWarp.fixedDeltaTime).ToArray();
var ratio = rates.Where(r => !r.Optional).Select(r => Misc.GetConnectedResources(this.part, r.Resource).Select(c => r.Rate > 0 ? c.amount : c.maxAmount - c.amount).DefaultIfEmpty().Max() / Math.Abs(r.Rate)).Prepend(1).Min();
var ratio = rates.Where(r => !r.Optional).Select(r => Misc.GetConnectedResources(this.part, r.Resource).Select(c => r.Rate > 0 ? c.amount : c.maxAmount - c.amount).DefaultIfEmpty().Max() / Math.Abs(r.Rate)).Where(r => r < 1).DefaultIfEmpty(1).Min();

var heatsink = this.part.Modules.OfType<HeatSinkAnimator>().SingleOrDefault();
if (heatsink != null)
Expand Down

0 comments on commit 3df9e5d

Please sign in to comment.