It is currently 07 Jul 2021, 14:47
   
Text Size

MagicStack.add

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins

MagicStack.add

Postby Max mtg » 28 May 2013, 11:29

There is such code at the end of MagicStack.add(SpellAbility sa)

Code: Select all
        if (!this.getSimultaneousStackEntryList().isEmpty()) {
            game.getPhaseHandler().passPriority();
        }
What is its purpose?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: MagicStack.add

Postby friarsol » 28 May 2013, 12:03

I believe simultaneousStackEntryList is keeping track of what triggers are hitting the stack at the same time for ordering (or at least was many a moon ago). I'm not sure why you would be passing priority if that were empty.
friarsol
Global Moderator
 
Posts: 7575
Joined: 15 May 2010, 04:20
Has thanked: 242 times
Been thanked: 956 times

Re: MagicStack.add

Postby Max mtg » 28 May 2013, 13:10

Well, there is no longer passPriority method... so I cannot sustain this code.

If there's a repro when current code won't work, please write it here or file as a bugreport.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: MagicStack.add

Postby Max mtg » 28 May 2013, 15:23

Found a repro : cast Bloodbraid Elf.
But it should not pass priority in that case - when Cascade trigger is added to stack

I commited r21786, seems to work as it should
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 14 guests


Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: No registered users and 14 guests

Login Form