Open cowmanjoe opened 5 years ago
Tagging this as Help Wanted and Good First Issue, since I'm suspecting this might be an easy fix, once the location and root cause of the error are identified.
Tried to reproduce, but can't trigger the error.
Some dirty, non-existing tiles can be observed when changing to a different tileset with a different number of tiles, but I believe it can be considered in the realm of "expected behavior", given the operation that is being performed.
@AdamsLair/duality-core can any of you try to see if they can reproduce this? otherwise I'd be considering closing the issue.
Reproduced the issue, the error only occurs when editing after the swap (causing the update function to be called).
I added in a simple bounds check and created a pull request This is my first time helping an opensource project so I hope I did everything properly!
Summary
An IndexOutOfRange exception is thrown if the selected Tilemap's Tileset is switched. This exception only occurs if the Tileset has been painted on with Tiles that have a higher index than the new Tileset's maximum index. I also noticed that sometimes the tile pallette is not updated with the new Tileset.
How to reproduce
Workaround
Analysis
Tile.cs:291
when in theUpdateAutoTileCon
method