* Fixed some problems for handling concede during game init.

This commit is contained in:
LevelX2 2017-11-04 18:19:41 +01:00
parent 5a9671cbca
commit 0d46c68924
3 changed files with 11 additions and 5 deletions

View file

@ -161,10 +161,9 @@ public class ComputerPlayer7 extends ComputerPlayer6 {
Game sim = createSimulation(game); Game sim = createSimulation(game);
SimulationNode2.resetCount(); SimulationNode2.resetCount();
root = new SimulationNode2(null, sim, maxDepth, playerId); root = new SimulationNode2(null, sim, maxDepth, playerId);
addActionsTimed(); addActionsTimed();
logger.trace("After add actions timed: root.children.size = " + root.children.size()); if (root.children != null && !root.children.isEmpty()) {
if (!root.children.isEmpty()) { logger.trace("After add actions timed: root.children.size = " + root.children.size());
root = root.children.get(0); root = root.children.get(0);
// int bestScore = root.getScore(); // int bestScore = root.getScore();
// if (bestScore > currentScore || allowBadMoves) { // if (bestScore > currentScore || allowBadMoves) {

View file

@ -205,7 +205,9 @@ public class HumanPlayer extends PlayerImpl {
return; return;
} }
response.clear(); response.clear();
loop = true; if (isInGame()) {
loop = true;
}
} }
} }
if (recordingMacro && !macroTriggeredSelectionFlag) { if (recordingMacro && !macroTriggeredSelectionFlag) {

View file

@ -563,7 +563,12 @@ public abstract class GameImpl implements Game, Serializable {
// } // }
@Override @Override
public void setConcedingPlayer(UUID playerId) { public void setConcedingPlayer(UUID playerId) {
Player player = getPlayer(state.getPriorityPlayerId()); Player player = null;
if (state.getChoosingPlayerId() != null) {
player = getPlayer(state.getChoosingPlayerId());
} else if (state.getPriorityPlayerId() != null) {
player = getPlayer(state.getPriorityPlayerId());
}
if (player != null) { if (player != null) {
if (!player.hasLeft() && player.isHuman()) { if (!player.hasLeft() && player.isHuman()) {
if (!concedingPlayers.contains(playerId)) { if (!concedingPlayers.contains(playerId)) {