Skip to content

Commit

Permalink
Fix the SSTU Tooling Code to look at 1.3 Version
Browse files Browse the repository at this point in the history
* Thanks to @MikeOnTea for pointing out I was using the newest version of SSTU to look for the data
* Attempt #1 to see how this works out
  • Loading branch information
pap1723 committed Dec 8, 2018
1 parent 6cfa5c2 commit 4bea1de
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Source/Tooling/ModuleToolingSSTUTank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ class ModuleToolingSSTUTank : ModuleToolingDiamLen
public override void OnAwake()
{
base.OnAwake();
SSTUTank = part.Modules["SSTUModularPart"];
// ******* 1.4+ SSTUTank = part.Modules["SSTUModularPart"];
SSTUTank = part.Modules["SSTUModularFuelTank"];
}
public override void OnLoad(ConfigNode node)
{
base.OnLoad(node);
SSTUTank = part.Modules["SSTUModularPart"];
// ******* 1.4+ SSTUTank = part.Modules["SSTUModularPart"];
SSTUTank = part.Modules["SSTUModularFuelTank"];
}
protected override void GetDimensions(out float diam, out float len)
{
Expand All @@ -32,13 +34,15 @@ protected override void GetDimensions(out float diam, out float len)
Debug.LogError("[ModuleTooling]: Could not find SSTU part to bind to");
return;
}

// Get diameter from part field and convert to Float
diam1 = SSTUTank.Fields["currentDiameter"];
// ******* 1.4+ diam1 = SSTUTank.Fields["currentDiameter"];
diam1 = SSTUTank.Fields["currentTankDiameter"];
diam = diam1.GetValue<float>(SSTUTank);

// Get core size from part field and convert to String
string coreStr = SSTUTank.Fields["currentCore"].GetValue<string>(SSTUTank);
// ******* 1.4+ string coreStr = SSTUTank.Fields["currentCore"].GetValue<string>(SSTUTank);
string coreStr = SSTUTank.Fields["currentTankType"].GetValue<string>(SSTUTank);
Debug.Log($"[RP1-ModuleTooling]: SSTU Tank Core: {coreStr}");

/* SSTU Modular Tanks are actually separate models and these are the 4 common models that
Expand Down

0 comments on commit 4bea1de

Please sign in to comment.