Skip to content

Commit

Permalink
nav: add option to configure slope height for autogenerated graphs (ref
Browse files Browse the repository at this point in the history
  • Loading branch information
jeefo committed May 30, 2024
1 parent f97876d commit bd9286c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/navigate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <yapb.h>

ConVar cv_has_team_semiclip ("has_team_semiclip", "0", "When enabled, bots will not try to avoid teammates on their way. Assuming some of the semiclip plugins are in use.");
ConVar cv_graph_slope_height ("graph_slope_height", "24.0", "Determines the maximum slope height change between the current and next node to consider the current link as a jump link. Only for generated graphs.", true, 12.0f, 48.0f);

int Bot::findBestGoal () {
if (m_isCreature) {
Expand Down Expand Up @@ -2458,7 +2459,7 @@ bool Bot::advanceMovement () {
const float diff = cr::abs (m_path->origin.z - graph[destIndex].origin.z);

// if height difference is enough, consider this link as jump link
if (graph[destIndex].origin.z > m_path->origin.z && diff > 18.0f) {
if (graph[destIndex].origin.z > m_path->origin.z && diff > cv_graph_slope_height.as <float> ()) {
m_currentTravelFlags |= PathFlag::Jump;
m_desiredVelocity = nullptr; // make bot compute jump velocity
m_jumpFinished = false; // force-mark this path as jump
Expand Down

0 comments on commit bd9286c

Please sign in to comment.