mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
fix gonti NPE #5748
This commit is contained in:
parent
7089a09061
commit
e77b21f4e9
1 changed files with 18 additions and 2 deletions
|
@ -184,7 +184,15 @@ class GontiLordOfLuxurySpendAnyManaEffect extends AsThoughEffectImpl implements
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
Card theCard = game.getCard(objectId);
|
||||
if(theCard == null){
|
||||
return false;
|
||||
}
|
||||
Card mainCard = theCard.getMainCard();
|
||||
if(mainCard == null){
|
||||
return false;
|
||||
}
|
||||
objectId = mainCard.getId(); // for split cards
|
||||
if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget())
|
||||
&& game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) {
|
||||
if (affectedControllerId.equals(source.getControllerId())) {
|
||||
|
@ -229,7 +237,15 @@ class GontiLordOfLuxuryLookEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
|
||||
Card theCard = game.getCard(objectId);
|
||||
if(theCard == null){
|
||||
return false;
|
||||
}
|
||||
Card mainCard = theCard.getMainCard();
|
||||
if(mainCard == null){
|
||||
return false;
|
||||
}
|
||||
objectId = mainCard.getId(); // for split cards
|
||||
if (affectedControllerId.equals(source.getControllerId())
|
||||
&& game.getState().getZone(objectId) == Zone.EXILED) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
|
Loading…
Reference in a new issue