CDrone: Check minAttackRange in InRange

This commit is contained in:
Luke Street 2020-09-13 19:36:28 -04:00
parent ecc8b73ead
commit 3780671ff6
1 changed files with 2 additions and 1 deletions

View File

@ -793,7 +793,8 @@ bool CDrone::Leash(CStateManager& mgr, float arg) {
}
bool CDrone::InRange(CStateManager& mgr, float arg) {
return (mgr.GetPlayer().GetTranslation() - GetTranslation()).magSquared() < x300_maxAttackRange * x300_maxAttackRange;
float mag = (mgr.GetPlayer().GetTranslation() - GetTranslation()).magSquared();
return mag > x2fc_minAttackRange * x2fc_minAttackRange && mag < x300_maxAttackRange * x300_maxAttackRange;
}
bool CDrone::SpotPlayer(CStateManager& mgr, float arg) {