From 0d4fcdcf4d8964db6b297c447c2e5a2f1a7dff15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Wed, 1 Feb 2023 14:08:19 +0600 Subject: [PATCH] fix: don't open the camp directions menu when removing the camp flag from a node created via the "Add Waypoint" menu (#402) * fix: open the camp directions selection menu when adding the camp flag to nodes with crossing flag --- src/control.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/control.cpp b/src/control.cpp index 8676404..688c1e7 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -1503,13 +1503,20 @@ int BotControl::menuGraphFlag (int item) { case 9: // if the node doesn't have a camp flag, set it and open the camp directions selection menu - if (graph[nearest].flags != NodeFlag::Camp) { + if (!(graph[nearest].flags & NodeFlag::Crossing) && !(graph[nearest].flags & NodeFlag::Camp)) { + graph.toggleFlags (NodeFlag::Crossing); + graph.toggleFlags (NodeFlag::Camp); + showMenu (Menu::CampDirections); + break; + } + else if ((graph[nearest].flags & NodeFlag::Crossing) && !(graph[nearest].flags & NodeFlag::Camp)) { graph.toggleFlags (NodeFlag::Camp); showMenu (Menu::CampDirections); break; } // otherwise remove the flag, and don't show the camp directions selection menu else { + graph.toggleFlags (NodeFlag::Crossing); graph.toggleFlags (NodeFlag::Camp); showMenu (Menu::NodeFlag); break;