Fixed ConcurrentModificationException in Game.saveScores Closes #882

This commit is contained in:
Beny 2020-11-02 03:39:15 +01:00
parent 44b7b25b43
commit c76b1b994f

View File

@ -240,7 +240,10 @@ public abstract class Game implements Runnable {
if (this.room == null)
return;
for (Map.Entry<GameTeamColors, GameTeam> teamEntry : this.teams.entrySet()) {
THashMap<GameTeamColors, GameTeam> teamsCopy = new THashMap<>();
teamsCopy.putAll(this.teams);
for (Map.Entry<GameTeamColors, GameTeam> teamEntry : teamsCopy.entrySet()) {
Emulator.getThreading().run(new SaveScoreForTeam(teamEntry.getValue(), this));
}
}