mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 18:20:17 +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 penaltyController from "./penalty_controller.js";
|
||||||
import zoneManager from "./zone_manager.js";
|
import zoneManager from "./zone_manager.js";
|
||||||
|
|
||||||
|
import { getDistanceFromLatLon } from "./map_utils.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The possible states of the game
|
* The possible states of the game
|
||||||
*/
|
*/
|
||||||
@@ -329,6 +331,13 @@ export default {
|
|||||||
if (this.state == GameState.PLAYING || this.state == GameState.FINISHED) {
|
if (this.state == GameState.PLAYING || this.state == GameState.FINISHED) {
|
||||||
return false;
|
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)
|
return zoneManager.udpateSettings(newSettings)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user