Fix NPE with Starforged Sword (#6188)

* Fix NPE

* Fix The Lord of Pain

---------

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2024-09-22 19:54:02 +02:00
committed by GitHub
parent 11a7f7b271
commit aebde7a1d0
4 changed files with 8 additions and 8 deletions

View File

@@ -64,7 +64,7 @@ public abstract class SpellAbilityEffect {
// prelude for when this is root ability
if (!(sa instanceof AbilitySub)) {
sb.append(sa.getHostCard()).append(" -");
if (sa.getHostCard().hasPromisedGift()) {
if (sa.getHostCard().hasPromisedGift() && sa.hasAdditionalAbility("GiftAbility")) {
sb.append(" Gift ").
append(sa.getAdditionalAbility("GiftAbility").getParam("GiftDescription")).
append(" to ").append(sa.getHostCard().getPromisedGift()).append(". ");

View File

@@ -24,11 +24,11 @@ public class PlayerProperty {
public static boolean playerHasProperty(Player player, String property, Player sourceController, Card source, CardTraitBase spellAbility) {
Game game = player.getGame();
if (property.endsWith("Activator")) {
sourceController = spellAbility.getHostCard().getController();
property = property.substring(0, property.length() - 9);
}
if (property.equals("You")) {
if (property.equals("Activator")) {
if (!player.equals(spellAbility.getHostCard().getController())) {
return false;
}
} else if (property.equals("You")) {
if (!player.equals(sourceController)) {
return false;
}