Fixed that no event was send for removing counters from players.

This commit is contained in:
LevelX2 2016-04-15 18:01:38 +02:00
parent 162ac957c6
commit 22dbb1ef38
8 changed files with 49 additions and 30 deletions

View file

@ -1839,6 +1839,18 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
@Override
public void removeCounters(String name, int amount, Ability source, Game game) {
for (int i = 0; i < amount; i++) {
counters.removeCounter(name, 1);
GameEvent event = GameEvent.getEvent(GameEvent.EventType.COUNTER_REMOVED,
getId(), (source == null ? null : source.getSourceId()), (source == null ? null : source.getControllerId()));
event.setData(name);
event.setAmount(1);
game.fireEvent(event);
}
}
protected boolean canDamage(MageObject source, Game game) {
for (ProtectionAbility ability : abilities.getProtectionAbilities()) {
if (!ability.canTarget(source, game)) {