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
This commit is contained in:
Владислав Сухов 2023-02-01 14:08:19 +06:00 committed by GitHub
commit 0d4fcdcf4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1503,13 +1503,20 @@ int BotControl::menuGraphFlag (int item) {
case 9: case 9:
// if the node doesn't have a camp flag, set it and open the camp directions selection menu // 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); graph.toggleFlags (NodeFlag::Camp);
showMenu (Menu::CampDirections); showMenu (Menu::CampDirections);
break; break;
} }
// otherwise remove the flag, and don't show the camp directions selection menu // otherwise remove the flag, and don't show the camp directions selection menu
else { else {
graph.toggleFlags (NodeFlag::Crossing);
graph.toggleFlags (NodeFlag::Camp); graph.toggleFlags (NodeFlag::Camp);
showMenu (Menu::NodeFlag); showMenu (Menu::NodeFlag);
break; break;