From 9879110c1fc66c92b1ba0f130c80c20a390d9bd9 Mon Sep 17 00:00:00 2001 From: Goober5000 Date: Mon, 26 Oct 2026 19:15:00 -0400 Subject: [PATCH] Fix jump node renames being lost in FRED2 The jump node dialog only copied control text into its member variables in OnClose(), so update_data() calls from selection changes, saves, and the dialog's own node menu applied stale values and discarded the edit. Call UpdateData(TRUE) inside update_data(), as the waypoint path dialog does. This regressed when the dialog was split out of the waypoint dialog in 78b957982. Co-Authored-By: Claude Opus 5.5 --- fred2/jumpnodedlg.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fred2/jumpnodedlg.cpp b/fred2/jumpnodedlg.cpp index c084ecea56..d496c5e104 100644 --- a/fred2/jumpnodedlg.cpp +++ b/fred2/jumpnodedlg.cpp @@ -109,9 +109,7 @@ void jumpnode_dlg::OnOK() { } void jumpnode_dlg::OnClose() -{ - UpdateData(TRUE); - +{ if (update_data()) { SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); bypass_errors = 0; @@ -173,6 +171,8 @@ int jumpnode_dlg::update_data(int redraw) if (!GetSafeHwnd()) return 0; + UpdateData(TRUE); + if (query_valid_object() && Objects[cur_object_index].type == OBJ_JUMP_NODE) { auto jnp = jumpnode_get_by_objnum(cur_object_index); Assertion(jnp != nullptr, "Jump node object not found in Jump_nodes vector?"); @@ -288,7 +288,7 @@ void jumpnode_dlg::OnChangeName() { char buffer[NAME_LENGTH]; - // Note, in this dialog, UpdateData(TRUE) is not used to move data from controls to variables until the dialog is closed, so we edit the control text directly + // Note, in this dialog, UpdateData(TRUE) is only used in update_data(), so we edit the control text directly // grab the name GetDlgItemText(IDC_NAME, buffer, NAME_LENGTH);