itsapi / pycraft

A Minecraft-inspired game for the terminal
GNU General Public License v2.0
197 stars 21 forks source link

Cursor out of bounds #95

Closed olls closed 8 years ago

olls commented 8 years ago

There is an error when the cursor is not on the screen. This can be triggered by falling out of the world with the cursor pointed down.

olls commented 8 years ago
Traceback (most recent call last):
  File "main.py", line 273, in <module>
    main()
  File "main.py", line 18, in main
    game(blocks, *ui.main())
  File "main.py", line 109, in game
    x, y, cursor, map_, blocks, meta['inv'], inv_sel
  File "/home/olls/Downloads/repos/python/pycraft/player.py", line 127, in cursor_colour
    block = blocks[ map_[ x + cursor_x[cursor] ][ y + cursor_y[cursor] ] ]
IndexError: list index out of range