Skip to content

Commit 01c720a

Browse files
committed
fixed map coordinates
1 parent e0aba86 commit 01c720a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tdl/map.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(self, width, height):
9494
self._map_cdata = _lib.TCOD_map_new(width, height)
9595
# cast array into cdata format: uint8[y][x]
9696
# for quick Python access
97-
self._array_cdata = _ffi.new('uint8[%i][%i]' % (width, height))
97+
self._array_cdata = _ffi.new('uint8[%i][%i]' % (height, width))
9898
# flat array to pass to TDL's C helpers
9999
self._array_cdata_flat = _ffi.cast('uint8 *', self._array_cdata)
100100
self.transparent = self._MapAttribute(self, 0)
@@ -152,8 +152,8 @@ def compute_fov(self, x, y, fov='PERMISSIVE', radius=None, light_walls=True,
152152
self._array_cdata_flat, cumulative)
153153
def iterate_fov():
154154
_array_cdata = self._array_cdata
155-
for y in range(self.width):
156-
for x in range(self.height):
155+
for y in range(self.height):
156+
for x in range(self.width):
157157
if(_array_cdata[y][x] & 4):
158158
yield (x, y)
159159
return iterate_fov()

0 commit comments

Comments
 (0)