LabWork_02 #3
@ -38,7 +38,7 @@ namespace WarmlyShip
|
||||
{
|
||||
for (int j = (int)(position.Left / _size_x); j <= (int)(position.Right / _size_x); ++j)
|
||||
{
|
||||
if (i >= 0 && j >= 0 && _map[i, j] == _barrier) return false;
|
||||
if (i >= 0 && j >= 0 && i < _map.GetLength(0) && j < _map.GetLength(1) && _map[i, j] == _barrier) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user