@@ -771,7 +771,8 @@ void WingEditorDialogModel::setArrivalType(ArrivalLocation newArrivalType)
771771 auto * w = getCurrentWing ();
772772 modify (w->arrival_location , newArrivalType);
773773
774- // If the new arrival type is a dock bay, clear warp in parameters
774+ // If the new arrival type is a dock bay, reset warp-in params to ship class defaults
775+ // (dock bay arrivals don't use warp effects; -1 would crash the save code)
775776 // else, clear arrival paths
776777 if (newArrivalType == ArrivalLocation::FROM_DOCK_BAY ) {
777778 for (auto & ship : Ships) {
@@ -780,7 +781,7 @@ void WingEditorDialogModel::setArrivalType(ArrivalLocation newArrivalType)
780781 if (ship.wingnum != _currentWingIndex)
781782 continue ;
782783
783- ship.warpin_params_index = - 1 ;
784+ ship.warpin_params_index = Ship_info[ship. ship_info_index ]. warpin_params_index ;
784785 }
785786 } else {
786787 modify (w->arrival_path_mask , 0 );
@@ -1104,7 +1105,8 @@ void WingEditorDialogModel::setDepartureType(DepartureLocation newDepartureType)
11041105 auto * w = getCurrentWing ();
11051106 modify (w->departure_location , newDepartureType);
11061107
1107- // If the new departure type is a dock bay,clear warp out parameters
1108+ // If the new departure type is a dock bay, reset warp-out params to ship class defaults
1109+ // (dock bay departures don't use warp effects; -1 would crash the save code)
11081110 // else, clear departure paths
11091111 if (newDepartureType == DepartureLocation::TO_DOCK_BAY ) {
11101112 for (auto & ship : Ships) {
@@ -1113,7 +1115,7 @@ void WingEditorDialogModel::setDepartureType(DepartureLocation newDepartureType)
11131115 if (ship.wingnum != _currentWingIndex)
11141116 continue ;
11151117
1116- ship.warpout_params_index = - 1 ;
1118+ ship.warpout_params_index = Ship_info[ship. ship_info_index ]. warpout_params_index ;
11171119 }
11181120 } else {
11191121 modify (w->departure_path_mask , 0 );
0 commit comments