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 <[email protected]>
This commit is contained in:
Goober5000andClaude Opus 5.5 committed 2026-10-26 19:15:00 -04:00
1 parent a8d5b3d6f9
commit 9879110c1f
1 file changed
+4 -4
+4 -4
View File
@@ -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);