* Fixed that AI fired targeting event twice (fixes #7094).

This commit is contained in:
LevelX2 2020-12-23 15:53:55 +01:00
parent dfa035d9dc
commit 2daa5aae50
3 changed files with 1 additions and 14 deletions

View file

@ -1233,18 +1233,6 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return true;
} // end priorityPlay method
@Override
public boolean activateAbility(ActivatedAbility ability, Game game) {
if (!isTestMode()) { // Test player already sends target event as they select the target
for (Target target : ability.getModes().getMode().getTargets()) {
for (UUID targetId : target.getTargets()) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.TARGETED, targetId, ability, ability.getControllerId()));
}
}
}
return super.activateAbility(ability, game);
}
protected void playLand(Game game) {
log.debug("playLand");
Set<Card> lands = new LinkedHashSet<>();

View file

@ -15,7 +15,6 @@ import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;

View file

@ -1500,7 +1500,7 @@ public abstract class PlayerImpl implements Player, Serializable {
if ((ability.isUsesStack()
|| ability.getRuleVisible())
&& !game.isSimulation()) {
game.informPlayers(getLogName() + ability.getGameLogMessage(game));
game.informPlayers(getLogName() + " - " + ability.getGameLogMessage(game));
}
if (!ability.isUsesStack()) {
ability.resolve(game);