diff options
-rw-r--r-- | pokemontools/gfx.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pokemontools/gfx.py b/pokemontools/gfx.py index 066811a..90d6213 100644 --- a/pokemontools/gfx.py +++ b/pokemontools/gfx.py @@ -141,8 +141,9 @@ def condense_tiles_to_map(image, pic=0): new_tiles += [tile] # Match the first frame where possible. - if tile == new_tiles[i % pic]: - tilemap += [i % pic] + this_i = i % pic if pic else i + if tile == new_tiles[this_i]: + tilemap += [this_i] else: tilemap += [new_tiles.index(tile)] |