mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
Merge branch 'assorted-fixes' into 'master'
Added NPE prevention for situations where AI evaluation for targeting cards with Shroud in MoJhoSto crashes the game. See merge request core-developers/forge!455
This commit is contained in:
@@ -4985,7 +4985,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Can target CardUID_").append(String.valueOf(getId()));
|
sb.append("Can target CardUID_").append(String.valueOf(getId()));
|
||||||
sb.append(" with spells and abilities as though it didn't have shroud.");
|
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();
|
result.setFalse();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user