aim: fix: ensure pathfinder succeeded when predicting
bot: support for x64 xash fwgs builds
This commit is contained in:
parent
fcda101224
commit
b816cd39aa
7 changed files with 238 additions and 6 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -765,6 +765,11 @@ bool Game::loadCSBinary () {
|
|||
}
|
||||
StringArray libs { "mp", "cs", "cs_i386" };
|
||||
|
||||
// lookup for x64 binaries first
|
||||
if (plat.x64) {
|
||||
libs.insert (0, { "mp_amd64", "cs_amd64" });
|
||||
}
|
||||
|
||||
auto libCheck = [&] (StringRef mod, StringRef dll) {
|
||||
// try to load gamedll
|
||||
if (!m_gameLib) {
|
||||
|
|
|
|||
|
|
@ -1473,7 +1473,7 @@ int Bot::findAimingNode (const Vector &to, int &pathLength) {
|
|||
return kInvalidNodeIndex;
|
||||
}
|
||||
|
||||
planner.find (destIndex, m_currentNodeIndex, [&] (int index) {
|
||||
auto result = planner.find (destIndex, m_currentNodeIndex, [&] (int index) {
|
||||
++pathLength;
|
||||
|
||||
if (vistab.visible (m_currentNodeIndex, index)) {
|
||||
|
|
@ -1483,7 +1483,7 @@ int Bot::findAimingNode (const Vector &to, int &pathLength) {
|
|||
return true;
|
||||
});
|
||||
|
||||
if (bestIndex == m_currentNodeIndex) {
|
||||
if (result && bestIndex == m_currentNodeIndex) {
|
||||
return kInvalidNodeIndex;
|
||||
}
|
||||
return bestIndex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue