Fixed cursor going out of bounds
This commit is contained in:
1 parent
cb74bdf740
commit
84a05355d9
1 file changed
+4
-4
+4
-4
@@ -79,6 +79,10 @@ function state_game()
|
|||||||
moved = true
|
moved = true
|
||||||
x += 1
|
x += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
x = mid(1, x, size)
|
||||||
|
y = mid(1, y, size)
|
||||||
|
|
||||||
if moved then
|
if moved then
|
||||||
selected_id = board:xy_idx(x, y)
|
selected_id = board:xy_idx(x, y)
|
||||||
end
|
end
|
||||||
@@ -88,10 +92,6 @@ function state_game()
|
|||||||
show_clues()
|
show_clues()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (x < 1) x = size
|
|
||||||
if (x > size) x = 1
|
|
||||||
if (y < 1) y = size
|
|
||||||
if (y > size) y = 1
|
|
||||||
check_endgame()
|
check_endgame()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user