louis-e / arnis

Arnis - Generate cities from real life in Minecraft
GNU General Public License v3.0
260 stars 18 forks source link

IndexError (moved from Discussions) #13

Closed louis-e closed 1 year ago

louis-e commented 1 year ago

Discussed in https://github.com/louis-e/arnis/discussions/9

Originally posted by **MrForquest** October 7, 2022 Hello, I got this error: Traceback (most recent call last): File "arnis.py", line 7, in from src.main import run File "D:\Desktop\python_projects_2022\arnis\src\main.py", line 118, in imgarray = processData(rawdata, args) File "D:\Desktop\python_projects_2022\arnis\src\processData.py", line 478, in processData if img[y][x] != 13: IndexError: index 25503 is out of bounds for axis 0 with size 25503 I think this is because the "round" function is rounding up the maximum value of the index. I replaced "round" to "int" and it worked. Now it looks like this: " for x in range( int(i[0] - waterwayWidth / 2), int(i[0] + waterwayWidth + 1 / 2), ): for y in range( int(i[1] - waterwayWidth / 2), int(i[1] + waterwayWidth + 1 / 2), ): if img[y][x] != 13: img[y][x] = 38 "
louis-e commented 1 year ago

Hi there, thanks for reporting this problem! I'm currently already working on a few new bug fixes which I will push to the master branch in the next few days, a patch to this bug will also be included. Thanks for your help!