nav: avoid players that are in view cone only
This commit is contained in:
parent
abb50a64c4
commit
f22f495940
1 changed files with 11 additions and 5 deletions
|
|
@ -533,7 +533,12 @@ void Bot::doPlayerAvoidance (const Vector &normal) {
|
|||
m_avoidAction = Dodge::None;
|
||||
return;
|
||||
}
|
||||
else if (m_avoidAction != Dodge::None) {
|
||||
else {
|
||||
if (util.getConeDeviation (ent (), m_hindrance->v.origin) < 0.8f) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_avoidAction != Dodge::None) {
|
||||
if (m_avoidAction == Dodge::Left) {
|
||||
setStrafeSpeed (normal, pev->maxspeed);
|
||||
}
|
||||
|
|
@ -541,6 +546,7 @@ void Bot::doPlayerAvoidance (const Vector &normal) {
|
|||
setStrafeSpeed (normal, -pev->maxspeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
const float interval = m_frameInterval * (!isDucking () && pev->velocity.lengthSq2d () > 0.0f ? 6.0f : 2.0f);
|
||||
|
||||
// use our movement angles, try to predict where we should be next frame
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue