mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Fixed possible static filter manipulation.
This commit is contained in:
parent
a46c70bd68
commit
083d4cee6d
4 changed files with 10 additions and 16 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -7,7 +6,6 @@ import mage.abilities.Mode;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -18,7 +16,7 @@ import mage.players.Player;
|
|||
*/
|
||||
public class TapAllTargetPlayerControlsEffect extends OneShotEffect {
|
||||
|
||||
private FilterPermanent filter;
|
||||
private final FilterPermanent filter;
|
||||
|
||||
public TapAllTargetPlayerControlsEffect(FilterPermanent filter) {
|
||||
super(Outcome.Tap);
|
||||
|
|
@ -34,8 +32,7 @@ public class TapAllTargetPlayerControlsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
filter.add(new ControllerIdPredicate(player.getId()));
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, player.getId(), game);
|
||||
for (Permanent p : permanents) {
|
||||
p.tap(game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue