mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-02 04:59:24 +00:00
Fix crash making a tileset bigger and pressing Remap (fix #4144)
This happens only if the tilemap already has tile references outside the valid range of the tileset (and even bigger than the new tileset size).
This commit is contained in:
parent
a6d9dce339
commit
340ed3f68f
@ -965,9 +965,11 @@ void ColorBar::onRemapTilesButtonClick()
|
||||
|
||||
if (n > 0) {
|
||||
for (const ImageRef& tilemap : tilemaps) {
|
||||
for (const doc::tile_t t : LockImageBits<TilemapTraits>(tilemap.get()))
|
||||
if (t != doc::notile)
|
||||
usedTiles[doc::tile_geti(t)] = true;
|
||||
for (const doc::tile_t t : LockImageBits<TilemapTraits>(tilemap.get())) {
|
||||
const doc::tile_index ti = doc::tile_geti(t);
|
||||
if (ti > 0 && ti < n)
|
||||
usedTiles[ti] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user