diff --git a/CHANGELOG.md b/CHANGELOG.md index 781f63f2..0ee96b8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ### Fixed - Fix text boxes in the Palette Editor calculating color incorrectly. - Fix default object sprites retaining dimensions and transparency of the previous sprite. +- Fix connections not being deleted when the map name text box is cleared. ## [5.1.1] - 2023-02-20 ### Added diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 519ec32b..4775d15b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2490,7 +2490,7 @@ void MainWindow::on_spinBox_ConnectionOffset_valueChanged(int offset) void MainWindow::on_comboBox_ConnectedMap_currentTextChanged(const QString &mapName) { - if (editor->project->mapNames.contains(mapName)) { + if (mapName.isEmpty() || editor->project->mapNames.contains(mapName)) { editor->setConnectionMap(mapName); markMapEdited(); } @@ -2522,7 +2522,7 @@ void MainWindow::on_pushButton_ConfigureEncountersJSON_clicked() { void MainWindow::on_comboBox_DiveMap_currentTextChanged(const QString &mapName) { - if (editor->project->mapNames.contains(mapName)) { + if (mapName.isEmpty() || editor->project->mapNames.contains(mapName)) { editor->updateDiveMap(mapName); markMapEdited(); } @@ -2530,7 +2530,7 @@ void MainWindow::on_comboBox_DiveMap_currentTextChanged(const QString &mapName) void MainWindow::on_comboBox_EmergeMap_currentTextChanged(const QString &mapName) { - if (editor->project->mapNames.contains(mapName)) { + if (mapName.isEmpty() || editor->project->mapNames.contains(mapName)) { editor->updateEmergeMap(mapName); markMapEdited(); }