-
Notifications
You must be signed in to change notification settings - Fork 69
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
Show nodes with respect to the equator #2170
Conversation
ksp_plugin/plugin.cpp
Outdated
&*renderer_->GetPlottingFrame()); | ||
if (cast_plotting_frame != nullptr) { | ||
auto const& plotting_frame = *cast_plotting_frame; | ||
auto const centre = dynamic_cast_not_null<RotatingBody<Barycentric> const*>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do *dynamic_cast_not_null
and you'll avoid all the ->
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dynamic_cast_not_null<OblateBody<Barycentric> const*>(centre)
below, and that becomes &dynamic_cast<OblateBody<Barycentric> const&>(centre)
, which, being passed as a not_null
parameter, induces a gratuitous nullness check.
Do we want that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed that.
@@ -1090,8 +1090,7 @@ private enum UnityLayers { | |||
// Advance the lagging vessels and kill those which collided with a | |||
// celestial. | |||
{ | |||
DisposableIterator collided_vessels; | |||
plugin_.CatchUpLaggingVessels(out collided_vessels); | |||
plugin_.CatchUpLaggingVessels(out DisposableIterator collided_vessels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a perfectly valid cleanup, but I'd rather avoid this stuff with mixing semantics as it makes the review really hard. The same holds for the places where string concatenations are replaced by $@""
strings.
Could you move all the cleanups to a different PR that would go in first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #2172.
@@ -192,13 +218,13 @@ public enum NodeSource { | |||
properties.object_type == MapObject.ObjectType.Periapsis | |||
? "Periapsis" | |||
: "Apoapsis"; | |||
CelestialBody celestial = properties.celestial; | |||
CelestialBody celestial = | |||
properties.reference_frame.selected_celestial; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would fit on previous line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
caption.captionLine2 = | ||
$"{speed:N0} m/s".ToString(Culture.culture); | ||
break; | ||
} | ||
case MapObject.ObjectType.PatchTransition: { | ||
CelestialBody celestial = | ||
properties.reference_frame.selected_celestial; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would fit on previous line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
This fixes #1841.