diff --git a/src/ui_renderer.cpp b/src/ui_renderer.cpp index 1078f96..aaa3cb5 100644 --- a/src/ui_renderer.cpp +++ b/src/ui_renderer.cpp @@ -494,8 +494,10 @@ void render_maneuver_create_tab(SimulationState* sim, UIState* ui_state, int x, Rectangle dir_label = {(float)x, (float)current_y, 80, 25}; GuiLabel(dir_label, "Direction:"); - Rectangle dir_combo = {(float)x + 85, (float)current_y, (float)(width - 95), 25}; - GuiDropdownBox(dir_combo, "Prograde;Retrograde;Normal;Antinormal;Radial In;Radial Out;Custom", &ui_state->maneuver_dialog.direction_active, false); + if (ui_state->maneuver_dialog.craft_index >= 0 && ui_state->maneuver_dialog.craft_index < sim->craft_count) { + Rectangle dir_combo = {(float)x + 85, (float)current_y, (float)(width - 95), 25}; + GuiDropdownBox(dir_combo, "Prograde;Retrograde;Normal;Antinormal;Radial In;Radial Out;Custom", &ui_state->maneuver_dialog.direction_active, false); + } current_y += 35; Rectangle dv_label = {(float)x, (float)current_y, 80, 25}; @@ -515,8 +517,10 @@ void render_maneuver_create_tab(SimulationState* sim, UIState* ui_state, int x, Rectangle trigger_label = {(float)x, (float)current_y, 80, 25}; GuiLabel(trigger_label, "Trigger:"); - Rectangle trigger_combo = {(float)x + 85, (float)current_y, (float)(width - 95), 25}; - GuiDropdownBox(trigger_combo, "Time;True Anomaly", &ui_state->maneuver_dialog.trigger_type_active, false); + if (ui_state->maneuver_dialog.craft_index >= 0 && ui_state->maneuver_dialog.craft_index < sim->craft_count) { + Rectangle trigger_combo = {(float)x + 85, (float)current_y, (float)(width - 95), 25}; + GuiDropdownBox(trigger_combo, "Time;True Anomaly", &ui_state->maneuver_dialog.trigger_type_active, false); + } current_y += 35; Rectangle value_label = {(float)x, (float)current_y, 80, 25};