fix: Player could not concede having Platinum Angel on battlefield

This commit is contained in:
Maxmtg
2011-08-22 23:23:23 +00:00
parent 2b86fbb7ba
commit 96b6bd0a99
3 changed files with 9 additions and 7 deletions

View File

@@ -75,7 +75,6 @@ import com.thoughtworks.xstream.XStreamException;
import forge.card.cardFactory.CardFactoryUtil; import forge.card.cardFactory.CardFactoryUtil;
import forge.error.ErrorViewer; import forge.error.ErrorViewer;
import forge.game.GameLossReason;
import forge.gui.ForgeAction; import forge.gui.ForgeAction;
import forge.gui.GuiUtils; import forge.gui.GuiUtils;
import forge.gui.game.CardDetailPanel; import forge.gui.game.CardDetailPanel;
@@ -1325,7 +1324,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
* Exit the Application * Exit the Application
*/ */
private void concede() { private void concede() {
AllZone.getHumanPlayer().loseConditionMet(GameLossReason.Conceded, null ); AllZone.getHumanPlayer().concede();
AllZone.getGameAction().checkStateEffects(); AllZone.getGameAction().checkStateEffects();
} }

View File

@@ -1479,8 +1479,11 @@ public abstract class Player extends MyObservable {
loseConditionSpell = spellName; loseConditionSpell = spellName;
return true; return true;
} }
public void concede() { // No cantLose checks - just lose
lossState = GameLossReason.Conceded;
loseConditionSpell = null;
}
/** /**
* <p>cantLose.</p> * <p>cantLose.</p>
@@ -1488,6 +1491,8 @@ public abstract class Player extends MyObservable {
* @return a boolean. * @return a boolean.
*/ */
public boolean cantLose() { public boolean cantLose() {
if (lossState == GameLossReason.Conceded) { return false; }
CardList list = AllZoneUtil.getPlayerCardsInPlay(this); CardList list = AllZoneUtil.getPlayerCardsInPlay(this);
list = list.getKeyword("You can't lose the game."); list = list.getKeyword("You can't lose the game.");

View File

@@ -203,9 +203,7 @@ public class SetInfoUtil {
int mostRecent = -1; int mostRecent = -1;
for (int i = 0; i < alSI.size(); i++) { for (SetInfo s : alSI) {
SetInfo s = alSI.get(i);
for (int j = 0; j < setData.size(); j++) { for (int j = 0; j < setData.size(); j++) {
if (setData.get(j).get("Code3").equals(s.Code)) { if (setData.get(j).get("Code3").equals(s.Code)) {
if (j > mostRecent) { if (j > mostRecent) {