Skip to content

Commit

Permalink
Recheck permissions in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPix committed Apr 14, 2022
1 parent d87a003 commit 00a895c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public void RefreshPlayerSettings(Player player) {
boolean noHitDelay = settingsManager.getBooleanSetting("NoHitDelay").getValue();
player.setMaximumNoDamageTicks(noHitDelay ? 0 : 20);
if(noHitDelay) player.setLastDamage(Integer.MAX_VALUE);
player.recalculatePermissions();
}

public void GreenPad(Player p){
Expand Down Expand Up @@ -256,6 +257,7 @@ public void EndGame(){
}
for(Player p : lobby.GetPlayers()){
CoreGame.GetImpl().SendTitle(p, Strings.GAME_RESET, "");
p.recalculatePermissions();
}
isDraw = true;
endCounter.Start();
Expand Down Expand Up @@ -322,6 +324,7 @@ public void AddPlayerToTeam(Player p, PlayerTeam team){
if(affectGame && !hasStarted) CheckGameReadyState();
if(team != PlayerTeam.Spectator) TeleportPlayer(p, team);
RefreshPlayerSettings(p);
p.recalculatePermissions();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ public HashSet<Player> GetPlayers(){
public void AddPlayer(Player p){
SendMessage(String.format(Strings.PLAYER_JOIN_LOBBY, p.getDisplayName()));
Match.AddPlayerToTeam(p, PlayerTeam.None);
p.recalculatePermissions();
}
public void RemovePlayer(Player p){
SendMessage(String.format(Strings.LEAVE_GAME, p.getDisplayName()));
Match.RemovePlayer(p);
if(GetPlayers().isEmpty() && (Match.hasStarted || Match.startCounter.isRunning()) && !Match.endCounter.isRunning()){
Match.EndGame();
}
p.recalculatePermissions();
}
public void SendMessage(String message){
for(Player p : GetPlayers()){
Expand Down

0 comments on commit 00a895c

Please sign in to comment.