mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
fixed penalty check bug
This commit is contained in:
@@ -79,9 +79,9 @@ export class PenaltyController {
|
||||
for (let team of game.teams) {
|
||||
if (team.penalties >= this.settings.maxPenalties) {
|
||||
this.game.capture(team.id);
|
||||
sendUpdatedTeamInformations(teamId);
|
||||
sendUpdatedTeamInformations(team.id);
|
||||
sendUpdatedTeamInformations(team.chased);
|
||||
teamBroadcast(teamId, "warning", "You have been eliminated (reason: too many penalties)")
|
||||
teamBroadcast(team.id, "warning", "You have been eliminated (reason: too many penalties)")
|
||||
teamBroadcast(team.chased, "success", "The team you were chasing has been eliminated")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ function logoutPlayer(id) {
|
||||
|
||||
export function sendUpdatedTeamInformations(teamId) {
|
||||
let team = game.getTeam(teamId)
|
||||
if(!team) {
|
||||
return false;
|
||||
}
|
||||
team.sockets.forEach(socketId => {
|
||||
io.of("player").to(socketId).emit("update_team", {
|
||||
name: team.name,
|
||||
|
||||
Reference in New Issue
Block a user