mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Trying to fix a ConcurrentModificationException during FFA match, if a player dies.
This commit is contained in:
parent
ec1607432f
commit
9a42d3d3f8
1 changed files with 5 additions and 1 deletions
|
|
@ -1520,9 +1520,13 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
*/
|
||||
|
||||
@Override
|
||||
public void leave(UUID playerId) {
|
||||
public synchronized void leave(UUID playerId) {
|
||||
Player player = getPlayer(playerId);
|
||||
player.leave();
|
||||
if (this.isGameOver()) {
|
||||
// no need to remove objects if only one player is left
|
||||
return;
|
||||
}
|
||||
//20100423 - 800.4a
|
||||
for (Iterator<Permanent> it = getBattlefield().getAllPermanents().iterator(); it.hasNext();) {
|
||||
Permanent perm = it.next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue