* Fixed bug in condition.

This commit is contained in:
LevelX2 2017-05-16 22:48:14 +02:00
parent d284cc08b1
commit 1362637561

View file

@ -38,18 +38,16 @@ import mage.watchers.common.PlayerDamagedBySourceWatcher;
*/
public class DealtDamageToAnOpponent implements Condition {
public DealtDamageToAnOpponent() {
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID opponentId: game.getOpponents(source.getControllerId())) {
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get(PlayerDamagedBySourceWatcher.class.getSimpleName(), opponentId);
if (watcher != null) {
return watcher.hasSourceDoneDamage(source.getSourceId(), game);
if (watcher.hasSourceDoneDamage(source.getSourceId(), game)) {
return true;
}
}
}
return false;
}
}