Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
73942b6
Added transmitter list update, decreased frequency of relay network a…
Boris-Barboris Dec 23, 2014
2cb0ec0
Added transmitter list periodical reconstruction, decreased relay nat…
Boris-Barboris Dec 23, 2014
adaebcd
animation fix, lesser step
Boris-Barboris Dec 23, 2014
0596a1f
moved persistent to memory
Boris-Barboris Dec 23, 2014
e8d1cce
20 to 10 - reciever freq
Boris-Barboris Dec 23, 2014
c835713
remove debug logging
Boris-Barboris Dec 23, 2014
c3fc619
disabled annoying 100% recieving\transmitting reset
Boris-Barboris Dec 24, 2014
4370fd8
Merge branch 'microwave_fixes'
Boris-Barboris Dec 24, 2014
a410107
initial adaptation
Boris-Barboris Dec 24, 2014
9878c0b
minor fix
Boris-Barboris Dec 24, 2014
583ad10
config update to fit new editor categories
Boris-Barboris Dec 24, 2014
17f1617
recommit microwave changes
Boris-Barboris Dec 24, 2014
451f42c
finally worked out microwave cases
Boris-Barboris Dec 24, 2014
815f042
minor fixes
Boris-Barboris Dec 24, 2014
9281596
tree update
Boris-Barboris Dec 24, 2014
06c24ae
solution reorganization
Boris-Barboris Dec 24, 2014
7d173f5
final microwave fixes and code refactoring
Boris-Barboris Dec 24, 2014
fad16b6
readme change
Boris-Barboris Dec 24, 2014
97456ff
readme change
Boris-Barboris Dec 24, 2014
8cec088
added scale fixes from the wiki to repo
Boris-Barboris Dec 25, 2014
ae03874
Merge branch 'update_0_90' into main
Boris-Barboris Dec 25, 2014
be0e3bf
master solidification of solution
Boris-Barboris Dec 25, 2014
90fb537
replaced redundant tree with TechManager config
Boris-Barboris Dec 25, 2014
40e7086
one solution to build two versions for 0.25 and for 0.90
Boris-Barboris Dec 25, 2014
1300140
Clamped solar power waste heat generation to inner planets only
Boris-Barboris Dec 25, 2014
7125883
animation fixes for radiators and microwave elements
Dec 26, 2014
0f544ee
reciever quickfix
Boris-Barboris Dec 26, 2014
6d22a74
final animation fix
Boris-Barboris Dec 26, 2014
da539d4
small changes
Boris-Barboris Dec 26, 2014
b22d3a0
reactor code light changes, power manager window fix
Boris-Barboris Dec 27, 2014
f343310
Merge branch 'develop'
Boris-Barboris Dec 27, 2014
05bb8e6
changed solar panel heating will migrate to dev branch
Dec 27, 2014
674283d
solar panel heat production changed
Dec 27, 2014
9f396a5
encorporated parts changes and changelog update
Boris-Barboris Dec 27, 2014
223a509
config update. Tweakscale additions. Fusion reactor scailing fix.
Boris-Barboris Dec 27, 2014
1d8e646
added vista tweakScale compatibility
Boris-Barboris Dec 27, 2014
8caf773
solar panel heating clamp is now togglable through WarpPluginSettings…
Boris-Barboris Dec 27, 2014
98a774a
microwave recievers scale tweak
Boris-Barboris Dec 27, 2014
56624ff
changelog edited
Boris-Barboris Dec 27, 2014
d9fb09e
initial CRP adaptation commit
Boris-Barboris Dec 28, 2014
db5105b
ArgonGas CRP adaptation
Boris-Barboris Dec 28, 2014
2a5cd30
texture path correction
Boris-Barboris Dec 28, 2014
b80e6c4
microwave fixes again, protovessels handling.
Boris-Barboris Dec 30, 2014
4c0194f
waste heat generation fix
Boris-Barboris Dec 30, 2014
103b58e
intersection code fix
Boris-Barboris Dec 30, 2014
c6ecded
accelerometer rollback and changelog
Boris-Barboris Dec 30, 2014
701097d
solar panel heating switch fix
Boris-Barboris Dec 30, 2014
fda1e98
microwave reciever core temperature tweak
Boris-Barboris Jan 1, 2015
0db1d3b
water and argon fix, reciever temp fix
Boris-Barboris Jan 2, 2015
8cb9411
Merge branch 'develop'
Boris-Barboris Jan 2, 2015
873e719
Fixed so that sail doesn't thrust toward sun when backside exposed, a…
bld Mar 2, 2015
f93a7c6
Thrust corrected to be always away from sun (using backside of sail) …
bld Mar 2, 2015
d320bd3
Merge pull request #1 from bld/master
Mar 8, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 26 additions & 70 deletions FNPlugin/AlcubierreDrive.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern alias ORSv1_4_2;
using ORSv1_4_2::OpenResourceSystem;
extern alias ORSv1_4_3;
using ORSv1_4_3::OpenResourceSystem;

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -260,76 +260,32 @@ public override void OnStart(PartModule.StartState state) {
warp_effect2.renderer.material.shader = Shader.Find("Unlit/Transparent");

warp_textures = new Texture[33];
warp_textures[0] = GameDatabase.Instance.GetTexture("WarpPlugin/warp", false);
warp_textures[1] = GameDatabase.Instance.GetTexture("WarpPlugin/warp2", false);
warp_textures[2] = GameDatabase.Instance.GetTexture("WarpPlugin/warp3", false);
warp_textures[3] = GameDatabase.Instance.GetTexture("WarpPlugin/warp4", false);
warp_textures[4] = GameDatabase.Instance.GetTexture("WarpPlugin/warp5", false);
warp_textures[5] = GameDatabase.Instance.GetTexture("WarpPlugin/warp6", false);
warp_textures[6] = GameDatabase.Instance.GetTexture("WarpPlugin/warp7", false);
warp_textures[7] = GameDatabase.Instance.GetTexture("WarpPlugin/warp8", false);
warp_textures[8] = GameDatabase.Instance.GetTexture("WarpPlugin/warp9", false);
warp_textures[9] = GameDatabase.Instance.GetTexture("WarpPlugin/warp10", false);
warp_textures[10] = GameDatabase.Instance.GetTexture("WarpPlugin/warp11", false);
warp_textures[11] = GameDatabase.Instance.GetTexture("WarpPlugin/warp10", false);
warp_textures[12] = GameDatabase.Instance.GetTexture("WarpPlugin/warp11", false);
warp_textures[13] = GameDatabase.Instance.GetTexture("WarpPlugin/warp12", false);
warp_textures[14] = GameDatabase.Instance.GetTexture("WarpPlugin/warp13", false);
warp_textures[15] = GameDatabase.Instance.GetTexture("WarpPlugin/warp14", false);
warp_textures[16] = GameDatabase.Instance.GetTexture("WarpPlugin/warp15", false);
warp_textures[17] = GameDatabase.Instance.GetTexture("WarpPlugin/warp16", false);
warp_textures[18] = GameDatabase.Instance.GetTexture("WarpPlugin/warp15", false);
warp_textures[19] = GameDatabase.Instance.GetTexture("WarpPlugin/warp14", false);
warp_textures[20] = GameDatabase.Instance.GetTexture("WarpPlugin/warp13", false);
warp_textures[21] = GameDatabase.Instance.GetTexture("WarpPlugin/warp12", false);
warp_textures[22] = GameDatabase.Instance.GetTexture("WarpPlugin/warp11", false);
warp_textures[23] = GameDatabase.Instance.GetTexture("WarpPlugin/warp10", false);
warp_textures[24] = GameDatabase.Instance.GetTexture("WarpPlugin/warp9", false);
warp_textures[25] = GameDatabase.Instance.GetTexture("WarpPlugin/warp8", false);
warp_textures[26] = GameDatabase.Instance.GetTexture("WarpPlugin/warp7", false);
warp_textures[27] = GameDatabase.Instance.GetTexture("WarpPlugin/warp6", false);
warp_textures[28] = GameDatabase.Instance.GetTexture("WarpPlugin/warp5", false);
warp_textures[29] = GameDatabase.Instance.GetTexture("WarpPlugin/warp4", false);
warp_textures[30] = GameDatabase.Instance.GetTexture("WarpPlugin/warp3", false);
warp_textures[31] = GameDatabase.Instance.GetTexture("WarpPlugin/warp2", false);
warp_textures[32] = GameDatabase.Instance.GetTexture("WarpPlugin/warp", false);

const string warp_tecture_path = "WarpPlugin/ParticleFX/warp";
for (int i = 0; i < 11; i++)
warp_textures[i] = GameDatabase.Instance.GetTexture((i > 0) ?
warp_tecture_path + (i + 1).ToString() : warp_tecture_path, false);
warp_textures[11] = GameDatabase.Instance.GetTexture("WarpPlugin/ParticleFX/warp10", false);
for (int i = 12; i < 33; i++)
{
int j = i > 17 ? 34 - i : i;
warp_textures[i] = GameDatabase.Instance.GetTexture(j > 1 ?
warp_tecture_path + (j + 1).ToString() : warp_tecture_path, false);
}

warp_textures2 = new Texture[33];
warp_textures2[0] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr", false);
warp_textures2[1] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr2", false);
warp_textures2[2] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr3", false);
warp_textures2[3] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr4", false);
warp_textures2[4] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr5", false);
warp_textures2[5] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr6", false);
warp_textures2[6] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr7", false);
warp_textures2[7] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr8", false);
warp_textures2[8] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr9", false);
warp_textures2[9] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr10", false);
warp_textures2[10] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr11", false);
warp_textures2[11] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr10", false);
warp_textures2[12] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr11", false);
warp_textures2[13] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr12", false);
warp_textures2[14] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr13", false);
warp_textures2[15] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr14", false);
warp_textures2[16] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr15", false);
warp_textures2[17] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr16", false);
warp_textures2[18] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr15", false);
warp_textures2[19] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr14", false);
warp_textures2[20] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr13", false);
warp_textures2[21] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr12", false);
warp_textures2[22] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr11", false);
warp_textures2[23] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr10", false);
warp_textures2[24] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr9", false);
warp_textures2[25] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr8", false);
warp_textures2[26] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr7", false);
warp_textures2[27] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr6", false);
warp_textures2[28] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr5", false);
warp_textures2[29] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr4", false);
warp_textures2[30] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr3", false);
warp_textures2[31] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr2", false);
warp_textures2[32] = GameDatabase.Instance.GetTexture("WarpPlugin/warpr", false);



const string warpr_tecture_path = "WarpPlugin/ParticleFX/warpr";
for (int i = 0; i < 11; i++)
warp_textures2[i] = GameDatabase.Instance.GetTexture((i > 0) ?
warpr_tecture_path + (i + 1).ToString() : warpr_tecture_path, false);
warp_textures2[11] = GameDatabase.Instance.GetTexture("WarpPlugin/ParticleFX/warpr10", false);
for (int i = 12; i < 33; i++)
{
int j = i > 17 ? 34 - i : i;
warp_textures2[i] = GameDatabase.Instance.GetTexture(j > 1 ?
warpr_tecture_path + (j + 1).ToString() : warpr_tecture_path, false);
}

warp_effect.renderer.material.color = new Color(Color.cyan.r, Color.cyan.g, Color.cyan.b, 0.5f);
warp_effect2.renderer.material.color = new Color(Color.red.r, Color.red.g, Color.red.b, 0.1f);
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/AluminiumElectrolyser.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern alias ORSv1_4_2;
using ORSv1_4_2::OpenResourceSystem;
extern alias ORSv1_4_3;
using ORSv1_4_3::OpenResourceSystem;

using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/AnthraquinoneProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern alias ORSv1_4_2;
using ORSv1_4_2::OpenResourceSystem;
extern alias ORSv1_4_3;
using ORSv1_4_3::OpenResourceSystem;

using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/AntimatterCollector.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
public class AntimatterCollector : PartModule {
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/AntimatterFactory.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
class AntimatterFactory {
Expand Down
6 changes: 3 additions & 3 deletions FNPlugin/AntimatterStorageTank.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
class AntimatterStorageTank : FNResourceSuppliableModule {
Expand Down Expand Up @@ -57,7 +57,7 @@ public void doExplode() {
lightGameObject.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
lightGameObject.AddComponent<Light>();
lightGameObject.renderer.material.shader = Shader.Find("Unlit/Transparent");
lightGameObject.renderer.material.mainTexture = GameDatabase.Instance.GetTexture("WarpPlugin/explode", false);
lightGameObject.renderer.material.mainTexture = GameDatabase.Instance.GetTexture("WarpPlugin/ParticleFX/explode", false);
lightGameObject.renderer.material.color = new Color(Color.white.r, Color.white.g, Color.white.b, 0.9f);
Light light = lightGameObject.light;
lightGameObject.transform.position = part.transform.position;
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/AtmosphericIntake.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern alias ORSv1_4_2;
using ORSv1_4_2::OpenResourceSystem;
extern alias ORSv1_4_3;
using ORSv1_4_3::OpenResourceSystem;

using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/ElectricEngineControllerFX.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin
{
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNLCMassSpectrometer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
class FNLCMassSpectrometer : PartModule {
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNMassSpectrometer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
class FNMassSpectrometer : PartModule{
Expand Down
21 changes: 13 additions & 8 deletions FNPlugin/FNModuleCryostat.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
[KSPModule("Cyrostat Tank")]
Expand Down Expand Up @@ -40,18 +40,23 @@ public override void OnUpdate() {
}

public override void OnFixedUpdate() {
if (cryostat_resource != null && cryostat_resource.amount > 0) {
if (cryostat_resource != null && cryostat_resource.amount > 0.0)
{
double charge = consumeFNResource(powerReqKW / 1000.0 * TimeWarp.fixedDeltaTime, FNResourceManager.FNRESOURCE_MEGAJOULES) * 1000.0;
if (charge <= powerReqKW * TimeWarp.fixedDeltaTime) {
if (charge <= powerReqKW * TimeWarp.fixedDeltaTime)
{
double rem_charge = powerReqKW * TimeWarp.fixedDeltaTime - charge;
charge += ORSHelper.fixedRequestResource(part, "ElectricCharge", rem_charge);
}
power_d = charge/TimeWarp.fixedDeltaTime;
power_d = charge / TimeWarp.fixedDeltaTime;

if (charge >= powerReqKW) {
if (charge >= powerReqKW)
{
cryostat_resource.amount = Math.Max(0, cryostat_resource.amount - boilOffRate * TimeWarp.fixedDeltaTime * cryostat_resource.maxAmount);
} else {
cryostat_resource.amount = Math.Max(0, cryostat_resource.amount - (boilOffRate + boilOffAddition) * TimeWarp.fixedDeltaTime * cryostat_resource.maxAmount*boilOffMultiplier);
}
else
{
cryostat_resource.amount = Math.Max(0, cryostat_resource.amount - (boilOffRate + boilOffAddition) * TimeWarp.fixedDeltaTime * cryostat_resource.maxAmount * boilOffMultiplier);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNModuleRadiation.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
[KSPModule("Radiation Status")]
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNModuleResourceExtraction.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
[KSPModule("Resource Extractor")]
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNNozzleController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern alias ORSv1_4_2;
using ORSv1_4_2::OpenResourceSystem;
extern alias ORSv1_4_3;
using ORSv1_4_3::OpenResourceSystem;

using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNNozzleControllerFX.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern alias ORSv1_4_2;
using ORSv1_4_2::OpenResourceSystem;
extern alias ORSv1_4_3;
using ORSv1_4_3::OpenResourceSystem;

using System;
using System.Collections.Generic;
Expand Down
7 changes: 4 additions & 3 deletions FNPlugin/FNRadiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ public override void OnStart(PartModule.StartState state) {
if (hasTechsRequiredToUpgrade()) {
isupgraded = true;
hasrequiredupgrade = true;
isupgraded = true;
}
return;
}
Expand All @@ -208,7 +207,9 @@ public override void OnStart(PartModule.StartState state) {
anim [animName].layer = 1;

if (radiatorIsEnabled) {
anim.Blend (animName, 1, 0);
anim[animName].normalizedTime = 1.0f;
anim[animName].enabled = true;
anim.Sample();
} else {
//anim.Blend (animName, 0, 0);
}
Expand Down Expand Up @@ -284,7 +285,7 @@ public override void OnFixedUpdate() {
pressure += dynamic_pressure;
float low_temp = FlightGlobals.getExternalTemperature (vessel.transform.position);

float delta_temp = Mathf.Max(0,radiatorTemp - low_temp);
float delta_temp = Mathf.Max(0, (float)current_rad_temp - low_temp);
conv_power_dissip = pressure * delta_temp * radiatorArea * rad_const_h/1e6f * TimeWarp.fixedDeltaTime*convectiveBonus;
if (!radiatorIsEnabled) {
conv_power_dissip = conv_power_dissip / 2.0f;
Expand Down
4 changes: 2 additions & 2 deletions FNPlugin/FNRefinery.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
[KSPModule("Refinery")]
Expand Down
15 changes: 7 additions & 8 deletions FNPlugin/FNResourceManager.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern alias ORSv1_4_2;
extern alias ORSv1_4_3;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using ORSv1_4_2::OpenResourceSystem;
using ORSv1_4_3::OpenResourceSystem;

namespace FNPlugin {
public class FNResourceManager : ORSResourceManager {
Expand All @@ -22,21 +22,20 @@ protected override void pluginSpecificImpl() {
flow_type = FNRESOURCE_FLOWTYPE_EVEN;
}

if (String.Equals(this.resource_name, FNResourceManager.FNRESOURCE_WASTEHEAT)) { // passive dissip of waste heat - a little bit of this
if (String.Equals(this.resource_name, FNResourceManager.FNRESOURCE_WASTEHEAT) &&
!PluginHelper.isThermalDissipationDisabled())
{ // passive dissip of waste heat - a little bit of this
double vessel_mass = my_vessel.GetTotalMass();
double passive_dissip = passive_temp_p4 * GameConstants.stefan_const * vessel_mass * 2.0;
internl_power_extract += passive_dissip * TimeWarp.fixedDeltaTime;

if (my_vessel.altitude <= PluginHelper.getMaxAtmosphericAltitude(my_vessel.mainBody)) { // passive convection - a lot of this
if (my_vessel.altitude <= PluginHelper.getMaxAtmosphericAltitude(my_vessel.mainBody))
{ // passive convection - a lot of this
double pressure = FlightGlobals.getStaticPressure(my_vessel.transform.position);
double delta_temp = 20;
double conv_power_dissip = pressure * delta_temp * vessel_mass * 2.0 * GameConstants.rad_const_h / 1e6 * TimeWarp.fixedDeltaTime;
internl_power_extract += conv_power_dissip;
}

if (internl_power_extract < 0 && PluginHelper.isThermalDissipationDisabled()) { // set buildup/dissip of waste heat to 0 if waste heat is disabled
internl_power_extract = 0;
}
}
}

Expand Down
Loading