mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
fix sorcery-speed LimitedTimesPerTurnActivatedAbility
calling super.canActivate() from inside activate() will always fail, because the stack is no longer empty
This commit is contained in:
parent
02a6780766
commit
cda5a06a6c
2 changed files with 8 additions and 7 deletions
|
|
@ -71,16 +71,17 @@ public class LimitedTimesPerTurnActivatedAbility extends ActivatedAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (super.canActivate(playerId, game)) {
|
||||
ActivationInfo activationInfo = getActivationInfo(game);
|
||||
return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn;
|
||||
}
|
||||
return false;
|
||||
return super.canActivate(playerId, game) && hasMoreActivationsThisTurn(game);
|
||||
}
|
||||
|
||||
private boolean hasMoreActivationsThisTurn(Game game) {
|
||||
ActivationInfo activationInfo = getActivationInfo(game);
|
||||
return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, boolean noMana) {
|
||||
if (canActivate(this.controllerId, game)) {
|
||||
if (hasMoreActivationsThisTurn(game)) {
|
||||
if (super.activate(game, noMana)) {
|
||||
ActivationInfo activationInfo = getActivationInfo(game);
|
||||
if (activationInfo == null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue