mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
rever to 9615d4fecd
This commit is contained in:
@@ -3,7 +3,6 @@ import { sendUpdatedTeamInformations, teamBroadcast } from "./team_socket.js";
|
||||
import { GameState } from "./game.js";
|
||||
import { secureAdminBroadcast } from "./admin_socket.js";
|
||||
import { game } from "./index.js";
|
||||
import { isInZone } from "./zone_manager.js";
|
||||
|
||||
export class PenaltyController {
|
||||
constructor() {
|
||||
@@ -92,10 +91,10 @@ export class PenaltyController {
|
||||
this.game.teams.forEach((team) => {
|
||||
if (team.captured) { return }
|
||||
//All the informations are not ready yet
|
||||
if (team.currentLocation == null) {
|
||||
if (team.currentLocation == null || this.game.zone.currentZone == null) {
|
||||
return;
|
||||
}
|
||||
if (!isInZone(team.currentLocation)) {
|
||||
if (!isInCircle({ lat: team.currentLocation[0], lng: team.currentLocation[1] }, this.game.zone.currentZone.center, this.game.zone.currentZone.radius)) {
|
||||
//The team was not previously out of the zone
|
||||
if (!this.outOfBoundsSince[team.id]) {
|
||||
this.outOfBoundsSince[team.id] = new Date();
|
||||
|
||||
Reference in New Issue
Block a user