diff --git a/src/planner.cpp b/src/planner.cpp index 64b1e13..7c0e8a9 100644 --- a/src/planner.cpp +++ b/src/planner.cpp @@ -38,9 +38,13 @@ float PlannerHeuristic::gfunctionKillsDistCTWithHostage (int team, int currentIn if (current.flags & NodeFlag::NoHostage) { return kInfiniteHeuristic; } - else if (current.flags & (NodeFlag::Crouch | NodeFlag::Ladder)) { - return gfunctionKillsDist (team, currentIndex, parentIndex) * 500.0f; + else if (current.flags & NodeFlag::Ladder) { + return gfunctionKillsDist (team, currentIndex, parentIndex) * 6.0f; } + else if (current.flags & NodeFlag::Crouch) { + return gfunctionKillsDist (team, currentIndex, parentIndex) * 3.0f; + } + return gfunctionKillsDist (team, currentIndex, parentIndex); } @@ -69,9 +73,13 @@ auto PlannerHeuristic::gfunctionKillsCTWithHostage (int team, int currentIndex, if (current.flags & NodeFlag::NoHostage) { return kInfiniteHeuristic; } - else if (current.flags & (NodeFlag::Crouch | NodeFlag::Ladder)) { - return gfunctionKills (team, currentIndex, parentIndex) * 500.0f; + else if (current.flags & NodeFlag::Ladder) { + return gfunctionKills (team, currentIndex, parentIndex) * 6.0f; } + else if (current.flags & NodeFlag::Crouch) { + return gfunctionKills (team, currentIndex, parentIndex) * 3.0f; + } + return gfunctionKills (team, currentIndex, parentIndex); } @@ -103,9 +111,13 @@ float PlannerHeuristic::gfunctionPathDistWithHostage (int, int currentIndex, int if (current.flags & NodeFlag::NoHostage) { return kInfiniteHeuristic; } - else if (current.flags & (NodeFlag::Crouch | NodeFlag::Ladder)) { - return gfunctionPathDist (Team::Unassigned, currentIndex, parentIndex) * 500.0f; + else if (current.flags & NodeFlag::Ladder) { + return gfunctionPathDist (Team::Unassigned, currentIndex, parentIndex) * 6.0f; } + else if (current.flags & NodeFlag::Crouch) { + return gfunctionPathDist (Team::Unassigned, currentIndex, parentIndex) * 3.0f; + } + return gfunctionPathDist (Team::Unassigned, currentIndex, parentIndex); } @@ -203,7 +215,7 @@ bool AStarAlgo::cantSkipNode (const int a, const int b, bool skipVisCheck) { const float distanceSq = ag.origin.distanceSq (bg.origin); const bool tooFar = distanceSq > cr::sqrf (400.0f); - const bool tooClose = distanceSq < cr::sqrtf (40.0f); + const bool tooClose = distanceSq < cr::sqrf (40.0f); if (tooFar || tooClose) { return true;