Skip to content

Commit

Permalink
avoid isp=NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
camlost2 committed Dec 28, 2014
1 parent 5d77ac9 commit 4a6551a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Source/EngineWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ public EngineWrapper(Part part)

public void SetIsp(float isp)
{
if (isp <= 0)
return;
FloatCurve resultcurve = new FloatCurve();
this.realIsp = isp;
isp = isp * IspMultiplier;
resultcurve.Add(0, isp);
resultcurve.Add(1, isp);

switch (type)
if (isp > 0)
{
case EngineType.ModuleEngine:
engine.atmosphereCurve = resultcurve;
break;
case EngineType.ModuleEngineFX:
engineFX.atmosphereCurve = resultcurve;
break;
case EngineType.FSengine:
// fsengine.fuelConsumption = "0,0.0001;1," + (fsengine.maxThrust * 1000f / 9.801f / isp).ToString();
break;
FloatCurve resultcurve = new FloatCurve();
this.realIsp = isp;
isp = isp * IspMultiplier;
resultcurve.Add(0, isp);
resultcurve.Add(1, isp);

switch (type)
{
case EngineType.ModuleEngine:
engine.atmosphereCurve = resultcurve;
break;
case EngineType.ModuleEngineFX:
engineFX.atmosphereCurve = resultcurve;
break;
case EngineType.FSengine:
// fsengine.fuelConsumption = "0,0.0001;1," + (fsengine.maxThrust * 1000f / 9.801f / isp).ToString();
break;
}
}

}

public void SetThrust(float t)
Expand Down

0 comments on commit 4a6551a

Please sign in to comment.