* AI player - Fixed a bug that sometimes valid targets were not taken into account.

This commit is contained in:
LevelX2 2014-03-15 17:44:56 +01:00
parent e103ddfd4b
commit 577b431029

View file

@ -1824,7 +1824,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
protected List<Permanent> threats(UUID playerId, UUID sourceId, FilterPermanent filter, Game game, List<UUID> targets) { protected List<Permanent> threats(UUID playerId, UUID sourceId, FilterPermanent filter, Game game, List<UUID> targets) {
List<Permanent> threats = (playerId == null || sourceId ==null) ? List<Permanent> threats = (playerId == null || sourceId ==null) ?
game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game) : // all permanents within the range of the player game.getBattlefield().getActivePermanents(filter, this.getId(), sourceId, game) : // all permanents within the range of the player
game.getBattlefield().getAllActivePermanents(filter, playerId, game); // all controlled permanents of playerId game.getBattlefield().getActivePermanents(filter, playerId, sourceId, game);
Iterator<Permanent> it = threats.iterator(); Iterator<Permanent> it = threats.iterator();
while (it.hasNext()) { // remove permanents already targeted while (it.hasNext()) { // remove permanents already targeted