mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
back: fix #23
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user