* Undo attack - Fixed a bug that prevented to work undo attack correctly.

This commit is contained in:
LevelX2 2014-12-31 13:49:37 +01:00
parent 4d6e818490
commit d0c0a7391d

View file

@ -194,15 +194,16 @@ public class Combat implements Serializable, Copyable<Combat> {
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARING_ATTACKERS, attackerId, attackerId))) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARING_ATTACKERS, attackerId, attackerId))) {
Player player = game.getPlayer(attackerId); Player player = game.getPlayer(attackerId);
//20101001 - 508.1d //20101001 - 508.1d
checkAttackRequirements(player, game); game.getCombat().checkAttackRequirements(player, game);
if (!game.getPlayer(game.getActivePlayerId()).getAvailableAttackers(game).isEmpty()) { if (!game.getPlayer(game.getActivePlayerId()).getAvailableAttackers(game).isEmpty()) {
player.selectAttackers(game, attackerId); player.selectAttackers(game, attackerId);
} }
if (game.isPaused() || game.gameOver(null)) { if (game.isPaused() || game.gameOver(null)) {
return; return;
} }
checkAttackRestrictions(player, game); // because of possible undo during declare attackers it's neccassary to call here the methods with "game.getCombat()." to get the valid combat object!!!
resumeSelectAttackers(game); game.getCombat().checkAttackRestrictions(player, game);
game.getCombat().resumeSelectAttackers(game);
} }
} }