The ship editor, wing editor, waypoint path dialog, and jump node
dialog all had near-identical code to check whether a new name
conflicts with an existing ship, wing, waypoint path, jump node, or
target priority group (or is empty, or begins with '<'). Both FRED2
and qtFRED carried their own copies of this logic.
Extract it into a single check_name_conflict() function in
code/missioneditor/common.cpp, shared by both editors, and replace the
duplicated validation at each call site with a one-line call:
- FRED2: shipeditordlg, wing_editor, waypointpathdlg, jumpnodedlg
- qtFRED: ShipEditorDialogModel, WaypointEditorDialogModel,
JumpNodeEditorDialogModel, and Editor::validate_wing_name
This also aligns a few small behavioral differences that had crept in
between the two editors: the waypoint and jump node dialogs now skip
empty wing slots (wave_count == 0) when checking for wing-name
collisions, and the qtFRED wing editor now rejects names beginning
with '<'.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
First, fix a crash reported in Discord: prevent FRED or QtFRED from giving a waypoint list a name that is too long.
Also fix the updating of references, including for the constituent points, if a waypoint list is renamed.
Partial revert of Mantis #2053:
http://scp.indiegames.us/mantis/view.php?id=2053
The patch was speculative and there was never a confirmed bug. By contrast, there are plenty of existing missions that use Unknown as a ship, wing, or jump node name and work just fine.