fix: non closeable autopath menu.
This commit is contained in:
parent
73ef635f09
commit
379feb8311
3 changed files with 21 additions and 14 deletions
|
|
@ -1428,21 +1428,20 @@ int BotControl::menuAutoPathDistance (int item) {
|
|||
showMenu (Menu::None); // reset menu display
|
||||
|
||||
constexpr float distances[] = { 0.0f, 100.0f, 130.0f, 160.0f, 190.0f, 220.0f, 250.0f };
|
||||
float result = 0.0f;
|
||||
|
||||
if (item >= 1 && item <= 7) {
|
||||
result = distances[item - 1];
|
||||
graph.setAutoPathDistance (result);
|
||||
graph.setAutoPathDistance (distances[item - 1]);
|
||||
}
|
||||
|
||||
if (cr::fzero (result)) {
|
||||
msg ("Autopathing is now disabled.");
|
||||
}
|
||||
else {
|
||||
msg ("Autopath distance is set to %.2f.", result);
|
||||
}
|
||||
showMenu (Menu::NodeAutoPath);
|
||||
switch (item) {
|
||||
default:
|
||||
showMenu (Menu::NodeAutoPath);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
showMenu (Menu::None);
|
||||
break;
|
||||
}
|
||||
return BotCommandResult::Handled;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1065,6 +1065,17 @@ void BotGraph::cachePoint (int index) {
|
|||
ctrl.msg ("Node %d has been put into memory.", m_cacheNodeIndex);
|
||||
}
|
||||
|
||||
void BotGraph::setAutoPathDistance (const float distance) {
|
||||
m_autoPathDistance = distance;
|
||||
|
||||
if (cr::fzero (distance)) {
|
||||
ctrl.msg ("Autopathing is now disabled.");
|
||||
}
|
||||
else {
|
||||
ctrl.msg ("Autopath distance is set to %.2f.", distance);
|
||||
}
|
||||
}
|
||||
|
||||
void BotGraph::calculatePathRadius (int index) {
|
||||
// calculate "wayzones" for the nearest node (meaning a dynamic distance area to vary node origin)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue