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:
parent
70c8af1464
commit
0d4fcdcf4d
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue