Skip to content

Commit

Permalink
Fix tileset palette saving crash
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Dec 4, 2024
1 parent 59c525e commit c2cf3cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- Fix some file dialogs returning to an incorrect window when closed.
- Fix bug where reloading a layout would overwrite all unsaved changes.
- Fix bug where layout json and blockdata could be saved separately leading to inconsistent data.
- Fix crash when saving tilesets with fewer palettes than the maximum.

## [5.4.1] - 2024-03-21
### Fixed
Expand Down
3 changes: 2 additions & 1 deletion src/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,8 @@ void Project::saveTilesetTilesImage(Tileset *tileset) {
}

void Project::saveTilesetPalettes(Tileset *tileset) {
for (int i = 0; i < Project::getNumPalettesTotal(); i++) {
int numPalettes = qMin(tileset->palettePaths.length(), tileset->palettes.length());
for (int i = 0; i < numPalettes; i++) {
QString filepath = tileset->palettePaths.at(i);
PaletteUtil::writeJASC(filepath, tileset->palettes.at(i).toVector(), 0, 16);
}
Expand Down

0 comments on commit c2cf3cc

Please sign in to comment.