fixed location disapearing

This commit is contained in:
2024-06-10 15:18:50 +00:00
parent 42257bd23d
commit 4f9608d25d

View File

@@ -167,6 +167,9 @@ export default class Game {
if (team == undefined) { if (team == undefined) {
return false; return false;
} }
if(location == null) {
return false;
}
team.currentLocation = location; team.currentLocation = location;
//Update the team ready status if they are in their starting area //Update the team ready status if they are in their starting area
if (this.state == GameState.PLACEMENT && team.startingArea && team.startingArea && location) { if (this.state == GameState.PLACEMENT && team.startingArea && team.startingArea && location) {
@@ -190,6 +193,10 @@ export default class Game {
if (team == undefined) { if (team == undefined) {
return false; return false;
} }
if(team.currentLocation == null) {
return false;
}
team.locationSendDeadline = Number(new Date()) + penaltyController.settings.allowedTimeBetweenPositionUpdate * 60 * 1000; team.locationSendDeadline = Number(new Date()) + penaltyController.settings.allowedTimeBetweenPositionUpdate * 60 * 1000;
team.lastSentLocation = team.currentLocation; team.lastSentLocation = team.currentLocation;
if (this.getTeam(team.chasing) != null) { if (this.getTeam(team.chasing) != null) {