mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Soulfire Grand Master - Fixed possible Cast exception.
This commit is contained in:
parent
89a21923a8
commit
684e76e9bf
1 changed files with 4 additions and 4 deletions
|
@ -193,11 +193,11 @@ class SoulfireGrandMasterCastFromHandReplacementEffect extends ReplacementEffect
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
Spell sourceSpell = (Spell) game.getObject(spellId);
|
MageObject mageObject = game.getObject(spellId);
|
||||||
if (sourceSpell != null && sourceSpell.isCopiedSpell()) {
|
if (mageObject == null || !(mageObject instanceof Spell) || ((Spell)mageObject).isCopiedSpell()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
Card sourceCard = (Card) game.getCard(spellId);
|
Card sourceCard = game.getCard(spellId);
|
||||||
if (sourceCard != null) {
|
if (sourceCard != null) {
|
||||||
Player player = game.getPlayer(sourceCard.getOwnerId());
|
Player player = game.getPlayer(sourceCard.getOwnerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
@ -218,7 +218,7 @@ class SoulfireGrandMasterCastFromHandReplacementEffect extends ReplacementEffect
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
//Something hit the stack from the hand, see if its a spell with this ability.
|
//Something hit the stack from the hand, see if its a spell with this ability.
|
||||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||||
if (spellId == null &&
|
if (spellId == null && // because this effect works only once, spellId has to be null here
|
||||||
zEvent.getFromZone() == Zone.HAND &&
|
zEvent.getFromZone() == Zone.HAND &&
|
||||||
zEvent.getToZone() == Zone.STACK &&
|
zEvent.getToZone() == Zone.STACK &&
|
||||||
event.getPlayerId().equals(source.getControllerId())) {
|
event.getPlayerId().equals(source.getControllerId())) {
|
||||||
|
|
Loading…
Reference in a new issue