From 3d0999ce8018ebbff1ba4366f530961308d6d26f Mon Sep 17 00:00:00 2001 From: Alexander Zheltov Date: Tue, 20 Aug 2019 18:00:57 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0,=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20=D0=BD=D0=B5=D1=82=20=D1=85?= =?UTF-8?q?=D0=BE=D1=80=D0=BE=D1=88=D0=B8=D1=85=20=D1=85=D0=BE=D0=B4=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B8=20=D1=8F=20=D0=BD=D0=B0=D1=85=D0=BE=D0=B6=D1=83?= =?UTF-8?q?=D1=81=D1=8C=20=D0=BD=D0=B0=20=D1=81=D0=B2=D0=BE=D0=B5=D0=B9=20?= =?UTF-8?q?=D1=82=D0=B5=D1=80=D1=80=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Такая проблема была в случае, если бот был уверен, что его окружат и при этом он был на своей территории --- MiniAiCup.Paperio.Core/Game.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MiniAiCup.Paperio.Core/Game.cs b/MiniAiCup.Paperio.Core/Game.cs index 0b91fa4..1f4cda4 100644 --- a/MiniAiCup.Paperio.Core/Game.cs +++ b/MiniAiCup.Paperio.Core/Game.cs @@ -109,10 +109,14 @@ public Direction GetNextDirection(GameState state) var nextState = GetNextState(bestState, currentState); nextDirection = nextState.Me.Direction.Value; } - else + else if (currentState.Me.PathToHome != null && currentState.Me.PathToHome.Length > 0) { nextDirection = currentState.Me.Position.GetDirectionTo(currentState.Me.PathToHome[0]); } + else + { + nextDirection = currentState.Me.Direction ?? Direction.Left; + } #if DEBUG stopwatch.Stop();