Skip to content

Commit a4c6c5d

Browse files
author
4b796c65
committed
Fixed a type issue with quickFOV
1 parent 7e2c85e commit a4c6c5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tdl/map.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def quickFOV(x, y, callback, fov='PERMISSIVE', radius=7.5, lightWalls=True, sphe
159159
@return: Returns a set of (x, y) points that are within the field-of-view.
160160
"""
161161
trueRadius = radius
162-
radius = math.ceil(radius)
162+
radius = int(math.ceil(radius))
163163
mapSize = radius * 2 + 1
164164
fov = _getFOVType(fov)
165165

@@ -168,8 +168,8 @@ def quickFOV(x, y, callback, fov='PERMISSIVE', radius=7.5, lightWalls=True, sphe
168168

169169
cTrue = ctypes.c_bool(1)
170170
cFalse = ctypes.c_bool(False)
171+
tcodMap = _lib.TCOD_map_new(mapSize, mapSize)
171172
try:
172-
tcodMap = _lib.TCOD_map_new(mapSize, mapSize)
173173
# pass one, write callback data to the tcodMap
174174
for (x_, cX), (y_, cY) in itertools.product(((i, ctypes.c_int(i)) for i in range(mapSize)),
175175
((i, ctypes.c_int(i)) for i in range(mapSize))):

0 commit comments

Comments
 (0)