Skip to content

Commit

Permalink
We have a utility for that.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleroy committed Oct 26, 2024
1 parent 0f6eb16 commit b1e09dc
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ksp_plugin/interface_planetarium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,13 @@ void __cdecl principia__PlanetariumPlotCelestialFutureTrajectory(
*minimal_distance_from_camera = std::numeric_limits<double>::infinity();
return m.Return();
} else {
auto& vessel = *plugin->GetVessel(vessel_guid);
auto const& vessel = *plugin->GetVessel(vessel_guid);
Instant const prediction_final_time = vessel.prediction()->t_max();
Instant final_time;
if (vessel.has_flight_plan()) {
vessel.ReadFlightPlanFromMessage();
final_time = std::max(vessel.flight_plan().actual_final_time(),
prediction_final_time);
} else {
final_time = prediction_final_time;
}
Instant const final_time =
vessel.has_flight_plan()
? std::max(GetFlightPlan(*plugin, vessel_guid).actual_final_time(),
prediction_final_time)
: prediction_final_time;
auto const& celestial_trajectory =
plugin->GetCelestial(celestial_index).trajectory();
// No need to request reanimation here because the current time of the
Expand Down

0 comments on commit b1e09dc

Please sign in to comment.