- FIXME: Added NPE prevention for situations where targeting cards with Shroud would be tested, but the SA activator would be null at this point (seems to happen for the AI in MoJhoSto matches; probably needs a more thorough long-term solution).

This commit is contained in:
Agetian
2018-04-21 19:58:03 +03:00
parent 5844de9b3c
commit 819301c7d8

View File

@@ -4985,7 +4985,10 @@ public class Card extends GameEntity implements Comparable<Card> {
StringBuilder sb = new StringBuilder();
sb.append("Can target CardUID_").append(String.valueOf(getId()));
sb.append(" with spells and abilities as though it didn't have shroud.");
if (!sa.getActivatingPlayer().hasKeyword(sb.toString())) {
if (sa.getActivatingPlayer() == null) {
System.err.println("Unexpected behavior: SA activator was null when trying to determine if the activating player could target a card with Shroud. SA host card = " + source + ", SA = " + sa);
result.setFalse(); // FIXME: maybe this should check by SA host card controller at this point instead?
} else if (!sa.getActivatingPlayer().hasKeyword(sb.toString())) {
result.setFalse();
}
break;