feat: announce going off route
This commit is contained in:
@ -179,10 +179,16 @@ async function tickRoute() {
|
|||||||
// Check if the user is on the route
|
// Check if the user is on the route
|
||||||
if (!isOnShape(loc, polyline)) {
|
if (!isOnShape(loc, polyline)) {
|
||||||
console.log("Off route!");
|
console.log("Off route!");
|
||||||
|
if (!info.isOffRoute) {
|
||||||
|
say("You went off route.");
|
||||||
|
}
|
||||||
info.isOffRoute = true;
|
info.isOffRoute = true;
|
||||||
// TODO: Implement re-routing logic
|
// TODO: Implement re-routing logic
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
if (info.isOffRoute) {
|
||||||
|
say("You are back on route.");
|
||||||
|
}
|
||||||
info.isOffRoute = false;
|
info.isOffRoute = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user