mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +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) {
|
||||
o = ((SpellAbility) c).getActivatingPlayer();
|
||||
}
|
||||
// For merged permanent
|
||||
if (c instanceof CardCollection) {
|
||||
o = ((CardCollection) c).get(0).getController();
|
||||
}
|
||||
}
|
||||
else if (defParsed.endsWith("Opponent")) {
|
||||
String triggeringType = defParsed.substring(9);
|
||||
@@ -1065,6 +1069,10 @@ public class AbilityUtils {
|
||||
if (c instanceof SpellAbility) {
|
||||
o = ((SpellAbility) c).getActivatingPlayer().getOpponents();
|
||||
}
|
||||
// For merged permanent
|
||||
if (c instanceof CardCollection) {
|
||||
o = ((CardCollection) c).get(0).getController().getOpponents();;
|
||||
}
|
||||
}
|
||||
else if (defParsed.endsWith("Owner")) {
|
||||
String triggeringType = defParsed.substring(9);
|
||||
@@ -1073,6 +1081,10 @@ public class AbilityUtils {
|
||||
if (c instanceof Card) {
|
||||
o = ((Card) c).getOwner();
|
||||
}
|
||||
// For merged permanent
|
||||
if (c instanceof CardCollection) {
|
||||
o = ((CardCollection) c).get(0).getOwner();
|
||||
}
|
||||
}
|
||||
else {
|
||||
final String triggeringType = defParsed.substring(9);
|
||||
|
||||
Reference in New Issue
Block a user