Skip to content

Commit

Permalink
Buffalo 2 compatibility update
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel-125 committed Oct 27, 2022
1 parent 5b4af67 commit d6f1852
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 3 deletions.
Binary file modified GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.dll
Binary file not shown.
Binary file modified GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.pdb
Binary file not shown.
3 changes: 3 additions & 0 deletions GameData/WildBlueIndustries/Snacks/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Copy the files in the zip folder over to GameData/Snacks

REVISION HISTORY

1.28.0
- Buffalo 2 compatibility update

1.27.5
- Sandcastle compatibility update

Expand Down
4 changes: 2 additions & 2 deletions GameData/WildBlueIndustries/Snacks/Snacks.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"VERSION":
{
"MAJOR":1,
"MINOR":27,
"PATCH":5
"MINOR":28,
"PATCH":0
},
"KSP_VERSION_MIN":
{
Expand Down
2 changes: 1 addition & 1 deletion Notes/Snacks.version
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"MAJOR":1,
"MINOR":27,
"PATCH":5
"PATCH":6
},
"KSP_VERSION_MIN":
{
Expand Down
16 changes: 16 additions & 0 deletions Snacks/Converters/SnacksConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ public class SnacksConverter: ModuleResourceConverter
/// </summary>
[KSPField]
public bool requiresSplashed = false;

/// <summary>
/// Flag indicating that the converter requires an oxygenated atmosphere in order to run.
/// </summary>
[KSPField]
public bool requiresOxygen = false;
#endregion

#region Background Processing Fields
Expand Down Expand Up @@ -397,6 +403,10 @@ public override string GetInfo()
if (requiresSplashed)
moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Requires vessel to be in water");

// Splashed
if (requiresOxygen)
moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Requires vessel to be on a planet with an oxygenated atmosphere");

//Home connection
if (requiresHomeConnection)
moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Requires connection to homeworld");
Expand Down Expand Up @@ -746,6 +756,12 @@ public override void FixedUpdate()
return;
}

if (requiresOxygen && !part.vessel.mainBody.atmosphereContainsOxygen)
{
status = "Requires oxygenated atmosphere";
return;
}

//Handle required resources
if (requiresHomeConnection && CommNet.CommNetScenario.CommNetEnabled && !this.part.vessel.connection.IsConnectedHome)
{
Expand Down
14 changes: 14 additions & 0 deletions Snacks/SettingsAndScenario/SnacksScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,20 @@ public void Start()
}
}
}

// Clear out data entries for astronauts that no longer exist.
string[] keys = crewData.Keys.ToArray();
KerbalRoster roster = HighLogic.CurrentGame.CrewRoster;
for (int index = 0; index < keys.Length; index++)
{
//rosterResources
if (!roster.Exists(keys[index]))
{
crewData.Remove(keys[index]);
if (rosterResources.ContainsKey(keys[index]))
rosterResources.Remove(keys[index]);
}
}
}

public void OnDestroy()
Expand Down
Binary file modified Snacks/bin/Debug/Assembly-CSharp-firstpass.dll
Binary file not shown.
Binary file modified Snacks/bin/Debug/Assembly-CSharp.dll
Binary file not shown.
Binary file modified Snacks/bin/Debug/SnacksUtils.dll
Binary file not shown.
Binary file modified Snacks/bin/Debug/SnacksUtils.pdb
Binary file not shown.
Binary file modified Snacks/bin/Debug/Unity.Analytics.DataPrivacy.dll
Binary file not shown.
Binary file modified Snacks/bin/Debug/UnityEngine.UI.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions Snacks/bin/Debug/xmldoc2md.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Snacks/obj/Debug/Snacks.csproj.AssemblyReference.cache
Binary file not shown.
Binary file modified Snacks/obj/Debug/SnacksUtils.dll
Binary file not shown.
Binary file modified Snacks/obj/Debug/SnacksUtils.pdb
Binary file not shown.

0 comments on commit d6f1852

Please sign in to comment.