Skip to content

Commit

Permalink
Merge pull request scp-fs2open#5996 from Goober5000/fix_ship_name_in_…
Browse files Browse the repository at this point in the history
…use_bug

fix "this ship name is already in use" bug
  • Loading branch information
Goober5000 authored Feb 26, 2024
2 parents 687694c + da31995 commit 1fe62ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fred2/shipeditordlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ int CShipEditorDlg::update_data(int redraw)
m_ship_name.TrimRight();
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (cur_object_index != OBJ_INDEX(ptr))) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (single_ship != ptr->instance)) {
str = Ships[ptr->instance].ship_name;
if (!stricmp(m_ship_name, str)) {
if (bypass_errors)
Expand Down
2 changes: 1 addition & 1 deletion qtfred/src/mission/dialogs/ShipEditorDialogModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ namespace fso {
drop_white_space(_m_ship_name);
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (_editor->currentObject != OBJ_INDEX(ptr))) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (single_ship != ptr->instance)) {
str = Ships[ptr->instance].ship_name;
if (!stricmp(_m_ship_name.c_str(), str)) {
auto button = _viewport->dialogProvider->showButtonDialog(DialogType::Error,
Expand Down

0 comments on commit 1fe62ea

Please sign in to comment.