mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
when disbanding a wing, delete its reinforcement entry
Also rename `remove_wing` to `disband_wing` for clarity.
This commit is contained in:
1 parent
b9e43f2907
commit
39c806771e
8 files changed
+12
-8
No files matched your search
+1
-1
@@ -2466,7 +2466,7 @@ int query_single_wing_marked()
|
||||
void CFREDView::OnDisbandWing()
|
||||
{
|
||||
if (query_single_wing_marked()) {
|
||||
remove_wing(cur_wing);
|
||||
disband_wing(cur_wing);
|
||||
FREDDoc_ptr->autosave("wing disband");
|
||||
|
||||
} else
|
||||
|
||||
+3
-1
@@ -442,7 +442,7 @@ void remove_ship_from_wing(int ship, int min) {
|
||||
rename_ship(ship, buf);
|
||||
}
|
||||
|
||||
void remove_wing(int wing_num)
|
||||
void disband_wing(int wing_num)
|
||||
{
|
||||
int i, total;
|
||||
object *ptr;
|
||||
@@ -450,6 +450,8 @@ void remove_wing(int wing_num)
|
||||
if (check_wing_dependencies(wing_num))
|
||||
return;
|
||||
|
||||
delete_reinforcement(Wings[wing_num].name);
|
||||
|
||||
Ship_editor_dialog.bypass_errors = Wing_editor_dialog.bypass_errors = 1;
|
||||
Ship_editor_dialog.update_data(0);
|
||||
total = Wings[wing_num].wave_count;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ int create_wing();
|
||||
*
|
||||
* @param[in] wing_num Index of the wing
|
||||
*/
|
||||
void remove_wing(int wing_num);
|
||||
void disband_wing(int wing_num);
|
||||
|
||||
/**
|
||||
* @brief Takes a ship out of a wing, deleting the wing if that was the only ship in it.
|
||||
|
||||
@@ -1078,7 +1078,7 @@ void wing_editor::OnDeleteWing()
|
||||
void wing_editor::OnDisbandWing()
|
||||
{
|
||||
modified = 0; // no need to run update checks, since wing will be gone shortly anyway.
|
||||
remove_wing(cur_wing);
|
||||
disband_wing(cur_wing);
|
||||
}
|
||||
|
||||
void wing_editor::OnGoals2()
|
||||
|
||||
@@ -1563,7 +1563,7 @@ int Editor::set_reinforcement(const char* name, int state) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
void Editor::remove_wing(int wing_num) {
|
||||
void Editor::disband_wing(int wing_num) {
|
||||
|
||||
int i, total;
|
||||
object* ptr;
|
||||
@@ -1572,6 +1572,8 @@ void Editor::remove_wing(int wing_num) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete_reinforcement(Wings[wing_num].name);
|
||||
|
||||
total = Wings[wing_num].wave_count;
|
||||
for (i = 0; i < total; i++) {
|
||||
ptr = &Objects[wing_objects[wing_num][i]];
|
||||
|
||||
@@ -233,7 +233,7 @@ class Editor : public QObject {
|
||||
*
|
||||
* @param[in] wing_num Index of the wing
|
||||
*/
|
||||
void remove_wing(int wing_num);
|
||||
void disband_wing(int wing_num);
|
||||
|
||||
void delete_marked();
|
||||
|
||||
|
||||
@@ -733,7 +733,7 @@ void WingEditorDialogModel::disbandCurrentWing()
|
||||
if (!wingIsValid())
|
||||
return;
|
||||
|
||||
_editor->remove_wing(_currentWingIndex);
|
||||
_editor->disband_wing(_currentWingIndex);
|
||||
reloadFromCurWing();
|
||||
}
|
||||
|
||||
|
||||
@@ -2694,7 +2694,7 @@ void FredView::on_actionWingForm_triggered(bool /*enabled*/) {
|
||||
}
|
||||
void FredView::on_actionWingDisband_triggered(bool /*enabled*/) {
|
||||
if (fred->query_single_wing_marked()) {
|
||||
fred->remove_wing(fred->cur_wing);
|
||||
fred->disband_wing(fred->cur_wing);
|
||||
} else {
|
||||
showButtonDialog(DialogType::Error,
|
||||
"Error",
|
||||
|
||||
Reference in new issue
Block a user