Skip to content

Commit

Permalink
Fixed possible duplication of Automapping Rules Tileset
Browse files Browse the repository at this point in the history
* Since path normalization was changing "://automap-tiles.tsx" to
  ":/automap-tiles.tsx", copy/pasting tiles in a rule map could lead to
  duplication of this tileset. Fixed by adding the tileset using the
  normalized path.

* The action to add the Automapping Rules Tileset would always add
  another copy of the tileset, regardless of whether it was already
  present. This was a bug caused by using Tiled::readTileset instead of
  TilesetManager::loadTileset.

Closes #3462
  • Loading branch information
bjorn committed Aug 29, 2022
1 parent 9e53a66 commit 48c4f85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Added file system actions to the tile context menu (#3448)
* Fixed possible crash in Custom Types Editor (#3465)
* Fixed ability to reset nested string and file properties (#3409)
* Fixed possible duplication of Automapping Rules Tileset (#3462)
* Fixed case where object labels could become visible for hidden layer (#3442)
* AutoMapping: Fixed applying of rule probability (#3425)

Expand Down
2 changes: 1 addition & 1 deletion src/tiled/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ void MainWindow::addAutomappingRulesTileset()
if (!mapDocument)
return;

auto tileset = Tiled::readTileset(QStringLiteral("://automap-tiles.tsx"));
auto tileset = TilesetManager::instance()->loadTileset(QStringLiteral(":/automap-tiles.tsx"));
if (!tileset) // Should never happen, but better do nothing than crash
return;

Expand Down

0 comments on commit 48c4f85

Please sign in to comment.