diff --git a/lib/goban.py b/lib/goban.py index 6b96a09..e3488b1 100644 --- a/lib/goban.py +++ b/lib/goban.py @@ -99,6 +99,9 @@ class Goban: def set_hover(self, pos): realpos = _real_pos(pos) + if _i(realpos) < 0 or _i(realpos) > 18 or _j(realpos) < 0 or _j(realpos) > 18: + return + if self.hover == realpos: return @@ -136,7 +139,7 @@ class Goban: board = p.in_dll(Goban.libboard, 'board') for pos in range(421): - if _i(pos) < 0 or _j(pos) < 0: + if _i(pos) < 0 or _i(pos) > 18 or _j(pos) < 0 or _j(pos) > 18: continue code = self._get_draw_code(pos, board[pos])