From 0584c4874c266e94e547ae5af68850df797df6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=20=D0=91=D0=BE=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Tue, 18 Oct 2022 18:57:38 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarmlyShip/WarmlyShip/AbstractMap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WarmlyShip/WarmlyShip/AbstractMap.cs b/WarmlyShip/WarmlyShip/AbstractMap.cs index 21023c3..b05b4fd 100644 --- a/WarmlyShip/WarmlyShip/AbstractMap.cs +++ b/WarmlyShip/WarmlyShip/AbstractMap.cs @@ -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;