mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Fixed a bug of abilities that trigger if a player cycles a card causing a "Game exception occurred: java.util.NoSuchElementException" error.
This commit is contained in:
parent
226a3f2e6b
commit
930b27226b
1 changed files with 5 additions and 4 deletions
|
@ -24,8 +24,7 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -41,7 +40,6 @@ import mage.game.stack.StackObject;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CycleAllTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public CycleAllTriggeredAbility(Effect effect, boolean optional) {
|
||||
|
@ -59,9 +57,12 @@ public class CycleAllTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getState().getStack().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
StackObject item = game.getState().getStack().getFirst();
|
||||
if (item instanceof StackAbility
|
||||
&& ((StackAbility)item).getStackAbility() instanceof CyclingAbility) {
|
||||
&& ((StackAbility) item).getStackAbility() instanceof CyclingAbility) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue