This commit is contained in:
Mathieu Oriol
2024-09-10 17:37:41 +02:00
parent 284dccb702
commit 0f2d0dc86a
2 changed files with 10 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ import { playersBroadcast, sendUpdatedTeamInformations } from "./team_socket.js"
import penaltyController from "./penalty_controller.js";
import zoneManager from "./zone_manager.js";
import { getDistanceFromLatLon } from "./map_utils.js";
/**
* The possible states of the game
*/
@@ -329,6 +331,13 @@ export default {
if (this.state == GameState.PLAYING || this.state == GameState.FINISHED) {
return false;
}
var min = newSettings.min;
var max = newSettings.max;
// The end zone must be included in the start zone
var dist = getDistanceFromLatLon(min.center, max.center);
if (min.radius + dist >= max.radius) {
return false;
}
return zoneManager.udpateSettings(newSettings)
},