fix: flaws in previous commit

This commit is contained in:
jeefo 2023-01-18 22:46:07 +03:00
commit 11c5e045d1
No known key found for this signature in database
GPG key ID: D85B0637366787C3

View file

@ -761,23 +761,19 @@ bool Bot::updateNavigation () {
m_enemy = client.ent;
m_lastEnemy = client.ent;
m_lastEnemyOrigin = client.ent->v.origin;
m_enemyParts = Visibility::None;
m_enemyParts = Visibility::Head;
m_enemyParts = Visibility::Body;
m_enemyParts |= (Visibility::Head | Visibility::Body);
m_states |= Sense::SeeingEnemy;
m_seeEnemyTime = game.time ();
break;
}
}
else {
if (graph.exists (m_previousNodes[0])) {
getEyesPos () = graph[m_previousNodes[0]].origin;
}
else {
game.testHull (getEyesPos (), m_path->origin, TraceIgnore::Monsters, pev->flags & FL_DUCKING ? head_hull : human_hull, ent (), &tr);
// someone is above or below us
// and is using the ladder already
// someone is above or below us and is using the ladder already
if (tr.pHit == client.ent && cr::abs (pev->origin.z - client.ent->v.origin.z) > 15.0f && (client.ent->v.movetype == MOVETYPE_FLY)) {
if (graph.exists (m_previousNodes[0])) {
if (!(graph[m_previousNodes[0]].flags & NodeFlag::Ladder)) {
@ -813,7 +809,7 @@ bool Bot::updateNavigation () {
}
}
}
}
}
}