Правки

This commit is contained in:
Danil Kargin 2022-10-16 17:13:19 +04:00
parent 7fb3ca88c9
commit 94a05eba86

View File

@ -78,9 +78,9 @@ namespace AirFighter
{
return 2;
}
for (int i = (int)(Top / _size_y); i <= (int)(Bottom / _size_y) + 1; i++)
for (int i = (int)(Top / _size_y); i <= (int)(Bottom / _size_y); i++)
{
for (int j = (int)(Left / _size_x); j <= (int)(Right / _size_x) + 1; j++)
for (int j = (int)(Left / _size_x); j <= (int)(Right / _size_x); j++)
{
if (_map[i, j] == _barrier)
return 0;
@ -106,22 +106,23 @@ namespace AirFighter
int flag = 0;
while (flag == 0)
{
flag = CheckBarrier((int)Right, (int)Left, (int)Top, (int)Bottom);
y += (int)_size_y;
Top += _size_y;
Bottom += _size_y;
Top += (int)_size_y;
Bottom += (int)_size_y;
_drawningObject.SetObject(x, y, _width, _height);
flag = CheckBarrier((int)Right, (int)Left, (int)Top, (int)Bottom);
}
if (flag == 1)
{
return true;
}
x += (int)_size_x;
Left += _size_x;
Right += _size_x;
Left += (int)_size_x;
Right += (int)_size_x;
y = (int)tempTop;
Top = tempTop;
Bottom = tempBottom;
Top = (int)tempTop;
Bottom = (int)tempBottom;
}
return false;
}