Made range inclusive
This commit is contained in:
parent
c8ac0b645f
commit
6ef3da2b25
@ -114,8 +114,8 @@ bool Perception::ObjectNearby(float direction, float range) {
|
|||||||
if (obj == nullptr)
|
if (obj == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (obj->position.angle > direction - range &&
|
if (obj->position.angle >= direction - range &&
|
||||||
obj->position.angle < direction + range) {
|
obj->position.angle <= direction + range) {
|
||||||
if (obj->position.distance <= nearbyDistance)
|
if (obj->position.distance <= nearbyDistance)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user