add cursor bounds check #3
This commit is contained in:
parent
4ddb3cebf6
commit
8d122b650f
|
@ -47,6 +47,9 @@ public class WorldGrid : Node2D
|
||||||
|
|
||||||
public void ToggleTileHighlight(int x, int y)
|
public void ToggleTileHighlight(int x, int y)
|
||||||
{
|
{
|
||||||
|
if (!IsInBounds(x, y))
|
||||||
|
return;
|
||||||
|
|
||||||
_tiles[x, y].isHighlighted ^= true;
|
_tiles[x, y].isHighlighted ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue