mirror of
https://github.com/correl/mage.git
synced 2024-11-24 11:09:54 +00:00
* Fixed some problems for handling concede during game init.
This commit is contained in:
parent
5a9671cbca
commit
0d46c68924
3 changed files with 11 additions and 5 deletions
|
@ -161,10 +161,9 @@ public class ComputerPlayer7 extends ComputerPlayer6 {
|
|||
Game sim = createSimulation(game);
|
||||
SimulationNode2.resetCount();
|
||||
root = new SimulationNode2(null, sim, maxDepth, playerId);
|
||||
|
||||
addActionsTimed();
|
||||
logger.trace("After add actions timed: root.children.size = " + root.children.size());
|
||||
if (!root.children.isEmpty()) {
|
||||
if (root.children != null && !root.children.isEmpty()) {
|
||||
logger.trace("After add actions timed: root.children.size = " + root.children.size());
|
||||
root = root.children.get(0);
|
||||
// int bestScore = root.getScore();
|
||||
// if (bestScore > currentScore || allowBadMoves) {
|
||||
|
|
|
@ -205,7 +205,9 @@ public class HumanPlayer extends PlayerImpl {
|
|||
return;
|
||||
}
|
||||
response.clear();
|
||||
loop = true;
|
||||
if (isInGame()) {
|
||||
loop = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (recordingMacro && !macroTriggeredSelectionFlag) {
|
||||
|
|
|
@ -563,7 +563,12 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
// }
|
||||
@Override
|
||||
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.hasLeft() && player.isHuman()) {
|
||||
if (!concedingPlayers.contains(playerId)) {
|
||||
|
|
Loading…
Reference in a new issue