Skip to content

Commit

Permalink
Added Vessel Landed State fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-bures committed Mar 13, 2023
1 parent a43665e commit d8c3674
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ This project aims to bring together community bug fixes for Kerbal Space Program

## Compatibility
- Tested with Kerbal Space Program 2 v0.1.0.0.20892
- Requires **[SpaceWarp 0.4+](https://github.com/SpaceWarpDev/SpaceWarp/releases/tag/spacewarp-0.4.0)**
- Requires **[SpaceWarp 0.4+](https://github.com/SpaceWarpDev/SpaceWarp/releases/)**

## Implemented fixes
- **Separation CommNet Fix** by [munix](https://github.com/jan-bures) - Fixes CommNet disconnecting after separating two controllable vessels.
- **Sticky Orbit Markers** by [munix](https://github.com/jan-bures) - Makes Ap/Pe and other orbit markers stay pinned when plotting a maneuver.
- **KSP 2 Save Fix** by [jayouimet](https://github.com/jayouimet) - Replaces the Control Owner Part to the first available Command module or to the Root part if not found when it is set to null.
- **Vessel Landed State Fix*** by [munix](https://github.com/jan-bures) - Checks if the vessel's state is Landed when not actually near the ground and resets it.

_*This fix is experimental and untested for now - if you are experiencing the bug with its fix enabled, please create an issue [here](https://github.com/Bit-Studios/CommunityFixes/issues)._

## Planned fixes
To see what fixes are planned to be implemented, you can visit the [Issues page](https://github.com/Bit-Studios/CommunityFixes/issues) on the project's GitHub.
Expand Down
2 changes: 1 addition & 1 deletion src/CommunityFixesMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CommunityFixesMod : BaseSpaceWarpPlugin
{
public const string ModGuid = "com.github.communityfixes";
public const string ModName = "Community Fixes";
public const string ModVer = "0.1.0";
public const string ModVer = "0.3.0";

private static readonly Assembly Assembly = typeof(CommunityFixesMod).Assembly;
private CommunityFixesConfig _config;
Expand Down
16 changes: 16 additions & 0 deletions src/Fix/VesselLandedState/VesselLandedStateFix.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using KSP.Sim.impl;

namespace CommunityFixes.Fix.VesselLandedState;

[Fix("Vessel Landed State")]
public class VesselLandedStateFix: BaseFix
{
private void LateUpdate()
{
var vessel = Game.ViewController.GetActiveSimVessel();
if (vessel != null && vessel.Situation == VesselSituations.Landed && vessel.AltitudeFromTerrain > 50)
{
vessel.Landed = false;
}
}
}
2 changes: 1 addition & 1 deletion swinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Community Fixes",
"description": "Community project that aims to bring together bug fixes for KSP 2.",
"source": "https://github.com/Bit-Studios/CommunityFixes",
"version": "0.1.0",
"version": "0.3.0",
"dependencies": [],
"ksp2_version": {
"min": "0.1.0",
Expand Down

0 comments on commit d8c3674

Please sign in to comment.