aim fix: conditions for failure in enemy prediction
This commit is contained in:
parent
8ac9b6c379
commit
405955d03f
3 changed files with 3 additions and 3 deletions
|
|
@ -205,7 +205,7 @@ public:
|
||||||
int getFarest (const Vector &origin, const float maxRange = 32.0);
|
int getFarest (const Vector &origin, const float maxRange = 32.0);
|
||||||
int getForAnalyzer (const Vector &origin, const float maxRange);
|
int getForAnalyzer (const Vector &origin, const float maxRange);
|
||||||
int getNearest (const Vector &origin, const float range = kInfiniteDistance, int flags = -1);
|
int getNearest (const Vector &origin, const float range = kInfiniteDistance, int flags = -1);
|
||||||
int getNearestNoBuckets (const Vector &origin, float nearestDistanceSq = kInfiniteDistance, int flags = -1);
|
int getNearestNoBuckets (const Vector &origin, const float range = kInfiniteDistance, int flags = -1);
|
||||||
int getEditorNearest (const float maxRange = 50.0f);
|
int getEditorNearest (const float maxRange = 50.0f);
|
||||||
int clearConnections (int index);
|
int clearConnections (int index);
|
||||||
int getBspSize ();
|
int getBspSize ();
|
||||||
|
|
|
||||||
|
|
@ -1773,7 +1773,7 @@ void Bot::syncUpdatePredictedIndex () {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::updatePredictedIndex () {
|
void Bot::updatePredictedIndex () {
|
||||||
if (m_lastEnemyOrigin.empty ()) {
|
if (m_lastEnemyOrigin.empty () || !vistab.isReady () || !util.isAlive (m_lastEnemy)) {
|
||||||
return; // do not run task if no last enemy
|
return; // do not run task if no last enemy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,7 @@ void Bot::setAimDirection () {
|
||||||
auto predictNode = m_lastPredictIndex;
|
auto predictNode = m_lastPredictIndex;
|
||||||
|
|
||||||
auto isPredictedIndexApplicable = [&] () -> bool {
|
auto isPredictedIndexApplicable = [&] () -> bool {
|
||||||
if (!vistab.visible (m_currentNodeIndex, predictNode) || !vistab.visible (m_previousNodes[0], predictNode)) {
|
if (!vistab.visible (m_currentNodeIndex, predictNode)) {
|
||||||
predictNode = kInvalidNodeIndex;
|
predictNode = kInvalidNodeIndex;
|
||||||
pathLength = kInfiniteDistanceLong;
|
pathLength = kInfiniteDistanceLong;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue