You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given stock code, this should always be 0 for everything except parts with ModuleProceduralFairing. But if some mod poked a different value into the prefab, this should be more correct. And if a mod poked a different module into the part instance, then we're kinda screwed anyway.
Copy file name to clipboardExpand all lines: Source/Modules/ModuleCoPFollowTransform.cs
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,11 @@ public override void OnLoad(ConfigNode node)
26
26
if(followTransform==null)Debug.LogError($"[{MODULENAME}] transformName '{transformName}' was empty or does not exist on part '{part.partInfo?.name}'");
27
27
}
28
28
29
-
if(followTransform==null)
29
+
if(followTransform==null&&part.partInfo!=null)
30
30
{
31
31
// this may be important if someone is swapping out versions of this module with B9PS
32
-
part.CoPOffset=Vector3.zero;
32
+
// Note this probably isn't correct for parts that also have modules that mess with this field (e.g. ModuleProceduralFairing)
33
+
part.CoPOffset=part.partInfo.CoPOffset;
33
34
}
34
35
35
36
// NOTE: isEnabled will be persisted to the save file, but we want to treat it purely as runtime state
0 commit comments