mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Fix crash when getting triggered controler for merged permanent
This commit is contained in:
@@ -1054,6 +1054,10 @@ public class AbilityUtils {
|
|||||||
if (c instanceof SpellAbility) {
|
if (c instanceof SpellAbility) {
|
||||||
o = ((SpellAbility) c).getActivatingPlayer();
|
o = ((SpellAbility) c).getActivatingPlayer();
|
||||||
}
|
}
|
||||||
|
// For merged permanent
|
||||||
|
if (c instanceof CardCollection) {
|
||||||
|
o = ((CardCollection) c).get(0).getController();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (defParsed.endsWith("Opponent")) {
|
else if (defParsed.endsWith("Opponent")) {
|
||||||
String triggeringType = defParsed.substring(9);
|
String triggeringType = defParsed.substring(9);
|
||||||
@@ -1065,6 +1069,10 @@ public class AbilityUtils {
|
|||||||
if (c instanceof SpellAbility) {
|
if (c instanceof SpellAbility) {
|
||||||
o = ((SpellAbility) c).getActivatingPlayer().getOpponents();
|
o = ((SpellAbility) c).getActivatingPlayer().getOpponents();
|
||||||
}
|
}
|
||||||
|
// For merged permanent
|
||||||
|
if (c instanceof CardCollection) {
|
||||||
|
o = ((CardCollection) c).get(0).getController().getOpponents();;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (defParsed.endsWith("Owner")) {
|
else if (defParsed.endsWith("Owner")) {
|
||||||
String triggeringType = defParsed.substring(9);
|
String triggeringType = defParsed.substring(9);
|
||||||
@@ -1073,6 +1081,10 @@ public class AbilityUtils {
|
|||||||
if (c instanceof Card) {
|
if (c instanceof Card) {
|
||||||
o = ((Card) c).getOwner();
|
o = ((Card) c).getOwner();
|
||||||
}
|
}
|
||||||
|
// For merged permanent
|
||||||
|
if (c instanceof CardCollection) {
|
||||||
|
o = ((CardCollection) c).get(0).getOwner();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final String triggeringType = defParsed.substring(9);
|
final String triggeringType = defParsed.substring(9);
|
||||||
|
|||||||
Reference in New Issue
Block a user