-
Notifications
You must be signed in to change notification settings - Fork 43
Description
In the second section of the FTS file, if you have two palettes with the same palette group and palette ID (in the same file or across multiple files), an unexpected error is raised:
Traceback (most recent call last):
File "coilsnake\ui\gui.py", line 304, in _do_compile_help
File "coilsnake\ui\common.py", line 162, in compile_project
File "coilsnake\modules\eb\TilesetModule.py", line 124, in write_to_rom
TypeError: '<' not supported between instances of 'EbMapPalette' and 'EbMapPalette'
The line in question is a call to the list of palettes' sort method. They're stored as a tuple with the palette ID (ranging from 0 to 7) and the actual palette data itself. When the IDs compare equal, Python tries to compare the palettes themselves to disambiguate the order, which of course doesn't make sense.
There should be explicit deduplication logic with a good error message when the same palette pops up twice, mentioning that palette's IDs. (This may require restructuring how palettes are read out of the FTS files to work in a natural and complete way. If the palettes exist across files, the error is currently silently ignored -- the first FTS file that contains the palette is used and other palettes are dropped.)