summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2015-04-21 09:49:02 -0700
committeryenatch <yenatch@gmail.com>2015-04-21 09:49:02 -0700
commitc6dcd9b9be874559d4d3d97f4f2fcb225b492c9b (patch)
tree97c08dfadfdd115b5c683508eb508be7d6a8f1c6
parent46492bd9075313a52622cc585fe7b2ca404cbdcd (diff)
Fix a modulo by 0 on a default argument to condense_tiles_to_map.
-rw-r--r--pokemontools/gfx.py5
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)]