Fixed wrong targetId in CAST_SPELL, fixed miss code from 7b7bbcadd6;

This commit is contained in:
Oleg Agafonov 2021-09-04 03:01:20 +04:00
parent a0e046bf70
commit 261f32d9b9
5 changed files with 48 additions and 26 deletions

View file

@ -108,8 +108,11 @@ public class SpellAbility extends ActivatedAbilityImpl {
// play restrict
// Check if rule modifying events prevent to cast the spell in check playable mode
if (game.inCheckPlayableState()) {
Card card = game.getCard(sourceId);
GameEvent castEvent = GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, this.getId(), this, playerId);
castEvent.setZone(card == null ? null : game.getState().getZone(card.getMainCard().getId()));
if (game.getContinuousEffects().preventedByRuleModification(
GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, this.getId(), this, playerId), this, game, true)) {
castEvent, this, game, true)) {
return ActivationStatus.getFalse();
}
}