forked from External/mage
getPermanent directly, not via getBattlefield
This commit is contained in:
parent
ad66b7439b
commit
10230f0d99
30 changed files with 45 additions and 45 deletions
|
|
@ -36,11 +36,11 @@ public class EnchantedSourceCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
int numberOfFoundEnchantments = 0;
|
||||
if (permanent != null) {
|
||||
for (UUID uuid : permanent.getAttachments()) {
|
||||
Permanent attached = game.getBattlefield().getPermanent(uuid);
|
||||
Permanent attached = game.getPermanent(uuid);
|
||||
if (attached != null && attached.isEnchantment(game) && (!aurasOnly || attached.hasSubtype(SubType.AURA, game))) {
|
||||
numberOfFoundEnchantments += 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue