Skip to content

Commit

Permalink
fix issue when tmx map has None for an image
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcraft committed Apr 8, 2022
1 parent bac30b6 commit 6ddbfac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyscroll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .isometric import IsometricBufferedRenderer
from .orthographic import BufferedRenderer

__version__ = 2, 29
__version__ = 2, 30
__author__ = "bitcraft"
__author_email__ = "[email protected]"
__description__ = "Pygame Scrolling"
6 changes: 4 additions & 2 deletions pyscroll/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,12 @@ def rev(seq, start, stop):
anim_map[gid].positions.add((x, y, l))
try:
# animated, so return the correct frame
yield x, y, l, at[(x, y, l)]
tile = at[(x, y, l)]
except KeyError:
# not animated, so return surface from data, if any
yield x, y, l, images[gid]
tile = images[gid]
if tile:
yield x, y, l, tile


class MapAggregator(PyscrollDataAdapter):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="pyscroll",
version="2.29",
version="2.30",
description="Fast scrolling maps library for pygame",
author="bitcraft",
author_email="[email protected]",
Expand Down

0 comments on commit 6ddbfac

Please sign in to comment.