Fix for crash in GameAction when QuestEvent is not a QuestChallenge

This commit is contained in:
Sol
2011-10-01 18:04:44 +00:00
parent 6ba90f2eff
commit 914beb6402

View File

@@ -1100,9 +1100,12 @@ public class GameAction {
AllZone.getComputerPlayer().setLife(computerLife, null); AllZone.getComputerPlayer().setLife(computerLife, null);
AllZone.getHumanPlayer().setLife(humanLife, null); AllZone.getHumanPlayer().setLife(humanLife, null);
if (qe != null && ((QuestChallenge)qe).getEventType().equals("challenge")) { if (qe != null && qe instanceof QuestChallenge){
QuestChallenge challenge = (QuestChallenge)qe;
if (challenge.getEventType().equals("challenge")) {
computer.addAll(forge.quest.data.QuestUtil.getComputerStartingCards(AllZone.getQuestData(), AllZone.getQuestEvent())); computer.addAll(forge.quest.data.QuestUtil.getComputerStartingCards(AllZone.getQuestData(), AllZone.getQuestEvent()));
} }
}
for (Card c : human) { for (Card c : human) {
for (Trigger trig : c.getTriggers()) { for (Trigger trig : c.getTriggers()) {