Prevent repeatable conceding (fixes #1526).

This commit is contained in:
rkfg 2016-03-03 11:43:50 +03:00
parent 527bb2a492
commit e2b62fecd8

View file

@ -1192,7 +1192,7 @@ public abstract class GameImpl implements Game, Serializable {
@Override @Override
public synchronized void concede(UUID playerId) { public synchronized void concede(UUID playerId) {
Player player = state.getPlayer(playerId); Player player = state.getPlayer(playerId);
if (player != null) { if (player != null && !player.hasLost()) {
logger.debug("Player " + player.getName() + " concedes game " + this.getId()); logger.debug("Player " + player.getName() + " concedes game " + this.getId());
fireInformEvent(player.getLogName() + " has conceded."); fireInformEvent(player.getLogName() + " has conceded.");
player.concede(this); player.concede(this);