geofence fix combined simple and polygon logic

- require being inside both fences, not either
This commit is contained in:
Daniel Agar 2016-12-13 19:40:55 -05:00 committed by Lorenz Meier
parent bce7ecb0f6
commit 17990cf5dc
1 changed files with 3 additions and 1 deletions

View File

@ -168,7 +168,9 @@ bool Geofence::inside(double lat, double lon, float altitude)
}
}
inside_fence |= inside_polygon(lat, lon, altitude);
// to be inside the geofence both fences have to report being inside
// as they both report being inside when not enabled
inside_fence = inside_fence && inside_polygon(lat, lon, altitude);
if (inside_fence) {
_outside_counter = 0;