-
Notifications
You must be signed in to change notification settings - Fork 13
isHome =/= is a ground station, add eventvoid hook to signal when the network updates #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
0ec4b3d
c6daea4
a2a15ad
43af45d
6a41ebc
09435b7
474807b
8826319
6572544
54694d2
042b445
63292f9
b28c74e
fb83b36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,8 @@ public class RealAntenna | |
| public virtual bool CanTarget => Shape != AntennaShape.Omni && !IsTracking; | ||
| public Vector3 ToTarget => (CanTarget && Target != null) ? (Vector3) (Target.transform.position - Position) : Vector3.zero; | ||
|
|
||
| // In the absence of a TARGET config node, antennas will target the centre of the home body. | ||
| // However, if the antenna belongs to a node with a ParentBody, Target will be set to null. | ||
| private Targeting.AntennaTarget _target; | ||
| public Targeting.AntennaTarget Target | ||
| { | ||
|
|
@@ -119,8 +121,13 @@ public virtual void LoadFromConfigNode(ConfigNode config) | |
| AMWTemp = (config.HasValue("AMWTemp")) ? float.Parse(config.GetValue("AMWTemp")) : 290f; | ||
| if (config.HasNode("TARGET")) | ||
| Target = Targeting.AntennaTarget.LoadFromConfig(config.GetNode("TARGET"), this); | ||
| else if (Shape != AntennaShape.Omni && (ParentNode == null || !ParentNode.isHome) && !(Target?.Validate() == true) && HighLogic.LoadedSceneHasPlanetarium) | ||
| else if (ParentNode is RACommNode RANode && RANode.isGroundStation) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we move this condition to SetDefaultTarget instead (and make the default target TARGET{} for ground stations)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think ParentNode being null is a sign something is broken. Can't participate in the network if you ...don't have a node in the network. Yeah, a validity check probably goes in SetDefaultTarget. |
||
| Debug.LogFormat($"{ModTag} ground station {RANode.displayName} antenna {Name} missing TARGET node - defaulted to null"); | ||
| Target = null; | ||
| } | ||
| else if (Shape != AntennaShape.Omni && !(Target?.Validate() == true) && HighLogic.LoadedSceneHasPlanetarium) | ||
| Target = Targeting.AntennaTarget.LoadFromConfig(SetDefaultTarget(), this); | ||
|
|
||
| EncoderOverride = (config.HasValue("EncoderOverride")) ? config.GetValue("EncoderOverride") : null; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.