This commit is contained in:
Макс Бондаренко 2022-10-18 18:57:38 +04:00
parent 5c14d4e6cc
commit 0584c4874c

View File

@ -38,7 +38,7 @@ namespace WarmlyShip
{ {
for (int j = (int)(position.Left / _size_x); j <= (int)(position.Right / _size_x); ++j) 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; return true;