mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
Corrections zones
This commit is contained in:
@@ -117,7 +117,7 @@ export default {
|
||||
if (team.currentLocation == null || !zoneManager.isRunning) {
|
||||
return;
|
||||
}
|
||||
if (!zoneManager.isInCircle({ lat: team.currentLocation[0], lng: team.currentLocation[1] })) {
|
||||
if (!zoneManager.isInZone({ lat: team.currentLocation[0], lng: team.currentLocation[1] })) {
|
||||
//The team was not previously out of the zone
|
||||
if (!this.outOfBoundsSince[team.id]) {
|
||||
this.outOfBoundsSince[team.id] = Date.now();
|
||||
|
||||
@@ -183,9 +183,12 @@ export default {
|
||||
|
||||
goNextZone() {
|
||||
this.currentZone.id++;
|
||||
if (this.currentZone.id >= this.zones.length) return;
|
||||
this.currentZone.timeoutId = setTimeout(() => this.goNextZone(), this.getCurrentZone().duration * 60 * 1000);
|
||||
this.currentZone.endDate = Date.now() + this.getCurrentZone().duration * 60 * 1000;
|
||||
if (this.currentZone.id >= this.zones.length - 1) {
|
||||
this.currentZone.endDate = Date.now();
|
||||
} else {
|
||||
this.currentZone.timeoutId = setTimeout(() => this.goNextZone(), this.getCurrentZone().duration * 60 * 1000);
|
||||
this.currentZone.endDate = Date.now() + this.getCurrentZone().duration * 60 * 1000;
|
||||
}
|
||||
this.zoneBroadcast();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user