From cef5466206abc003c466e88fc9b6558fefecb109 Mon Sep 17 00:00:00 2001 From: Raymond Beehler <21GunSoftware@comcast.net> Date: Tue, 18 Aug 2026 14:43:16 -0700 Subject: [PATCH 1/3] Update GetFlightAccelerationInternalSpace() to support PhysicsHold mod This seems to work, but probably could use some testing. Also, it will prevent surface bases from getting lower gravity at high altitudes, but that should be so small a difference as to not matter. --- FreeIva/FreeIva.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/FreeIva/FreeIva.cs b/FreeIva/FreeIva.cs index 4e92d1b4..5e85011b 100644 --- a/FreeIva/FreeIva.cs +++ b/FreeIva/FreeIva.cs @@ -676,7 +676,15 @@ internal static Vector3 GetFlightAccelerationInternalSpace(Part part, Vector3 in if (magnitude <= 0.01f) { - return Vector3.zero; + if (FlightGlobals.ActiveVessel.LandedOrSplashed) //In this event, we can safely assume surface gravity will be applied, since the base is landed. This allows for support for packed bases like in PhysicsHold mod. + { + accelWorldSpace = Vector3.MoveTowards(Vector3.zero, FlightGlobals.currentMainBody.position, (float)(FlightGlobals.currentMainBody.gravParameter / (double)(Vector3.Distance(InternalSpace.InternalToWorld(internalSpacePosition), FlightGlobals.currentMainBody.position) * Vector3.Distance(InternalSpace.InternalToWorld(internalSpacePosition), FlightGlobals.currentMainBody.position)))); + magnitude = vector.magnitude; + } + else + { + return Vector3.zero; + } } return WorldDirectionToInternal(accelWorldSpace) * magnitude; From 5acaaf946d452281a9d88b4457df7335a0237d61 Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Sun, 13 Sep 2026 13:34:03 -0400 Subject: [PATCH 2/3] Refactor acceleration logic for packed bases support Updated acceleration calculation for landed vessels to support packed bases. --- FreeIva/FreeIva.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/FreeIva/FreeIva.cs b/FreeIva/FreeIva.cs index 5e85011b..ff77584f 100644 --- a/FreeIva/FreeIva.cs +++ b/FreeIva/FreeIva.cs @@ -645,7 +645,15 @@ internal static Vector3 GetFlightAccelerationInternalSpace(Part part, Vector3 in if (FlightGlobals.ActiveVessel.LandedOrSplashed) { - accelWorldSpace = FlightGlobals.ActiveVessel.graviticAcceleration; + // This allows for support for packed bases like in PhysicsHold mod. graviticAcceleration is only updated when unpacked + if (FlightGlobals.ActiveVessel.packed) + { + accelWorldSpace = FlightGlobals.ActiveVessel.gravityTrue; + } + else + { + accelWorldSpace = FlightGlobals.ActiveVessel.graviticAcceleration; + } } else { @@ -676,15 +684,7 @@ internal static Vector3 GetFlightAccelerationInternalSpace(Part part, Vector3 in if (magnitude <= 0.01f) { - if (FlightGlobals.ActiveVessel.LandedOrSplashed) //In this event, we can safely assume surface gravity will be applied, since the base is landed. This allows for support for packed bases like in PhysicsHold mod. - { - accelWorldSpace = Vector3.MoveTowards(Vector3.zero, FlightGlobals.currentMainBody.position, (float)(FlightGlobals.currentMainBody.gravParameter / (double)(Vector3.Distance(InternalSpace.InternalToWorld(internalSpacePosition), FlightGlobals.currentMainBody.position) * Vector3.Distance(InternalSpace.InternalToWorld(internalSpacePosition), FlightGlobals.currentMainBody.position)))); - magnitude = vector.magnitude; - } - else - { - return Vector3.zero; - } + return Vector3.zero; } return WorldDirectionToInternal(accelWorldSpace) * magnitude; From d879292651a74c62a60f662ff84ef00548b1a7e1 Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Sun, 13 Sep 2026 13:41:54 -0400 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34aa9056..92433bf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ * Fix incorrect part name for orbital engine cluster from Near Future Spacecraft * Fix issues with B9PSConditionalProp when applied to hatches. Props are now deleted instead of deactivated if their subtype is not active. * Add missing bottom hatch to vertical hub node from Planetside +* Fixed bugs when using PhysicsHold (thanks @R-T-B) ## 0.2.20.2 - 2025-10-24 @@ -690,4 +691,4 @@ * Fixed issues with craft containing multiple instances of the same part. * GUI cleanup. * Made sounds configurable. -* Assorted small bugfixes. \ No newline at end of file +* Assorted small bugfixes.