aim: fix: ensure pathfinder succeeded when predicting

bot: support for x64 xash fwgs builds
This commit is contained in:
jeefo 2023-05-25 05:20:30 +03:00
commit b816cd39aa
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
7 changed files with 238 additions and 6 deletions

View file

@ -1576,7 +1576,7 @@ void Bot::syncUpdatePredictedIndex () {
}
int pathLength = 0;
planner.find (destIndex, currentNodeIndex, [&] (int index) {
auto result = planner.find (destIndex, currentNodeIndex, [&] (int index) {
++pathLength;
if (vistab.visible (currentNodeIndex, index) && botOrigin.distanceSq (graph[index].origin) > cr::sqrf (256.0f)) {
@ -1586,7 +1586,7 @@ void Bot::syncUpdatePredictedIndex () {
return true;
});
if (bestIndex != kInvalidNodeIndex) {
if (result && bestIndex != kInvalidNodeIndex) {
m_lastPredictIndex = bestIndex;
m_lastPredictLength = pathLength;