mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Fixed a possible NPE in destroyNoRegeneration.
This commit is contained in:
@@ -1221,6 +1221,7 @@ public class GameAction {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public final boolean destroyNoRegeneration(final Card c, final SpellAbility sa) {
|
public final boolean destroyNoRegeneration(final Card c, final SpellAbility sa) {
|
||||||
|
Player activator = null;
|
||||||
if (!c.canBeDestroyed())
|
if (!c.canBeDestroyed())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1266,13 +1267,16 @@ public class GameAction {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} // totem armor
|
} // totem armor
|
||||||
|
if (sa != null) {
|
||||||
|
activator = sa.getActivatingPlayer();
|
||||||
|
}
|
||||||
|
|
||||||
// Play the Destroy sound
|
// Play the Destroy sound
|
||||||
game.getEvents().post(new CardDestroyedEvent());
|
game.getEvents().post(new CardDestroyedEvent());
|
||||||
// Run triggers
|
// Run triggers
|
||||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||||
runParams.put("Card", c);
|
runParams.put("Card", c);
|
||||||
runParams.put("Causer", sa.getActivatingPlayer());
|
runParams.put("Causer", activator);
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.Destroyed, runParams, false);
|
game.getTriggerHandler().runTrigger(TriggerType.Destroyed, runParams, false);
|
||||||
|
|
||||||
return this.sacrificeDestroy(c);
|
return this.sacrificeDestroy(c);
|
||||||
|
|||||||
Reference in New Issue
Block a user