mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Prevent crash when winning quest match
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package forge.screens.match.winlose;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.GuiBase;
|
||||
import forge.LobbyPlayer;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -133,19 +134,24 @@ public class QuestWinLose extends ControlWinLose {
|
||||
if (!lastGame.getMatch().isMatchOver()) {
|
||||
getView().getBtnQuit().setText("Quit (-15 Credits)");
|
||||
return isAnte;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
getView().getBtnContinue().setVisible(false);
|
||||
if (wonMatch) {
|
||||
getView().getBtnQuit().setText("Great!");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
getView().getBtnQuit().setText("OK");
|
||||
}
|
||||
}
|
||||
|
||||
//invoke remaining logic in background thread so dialogs can be shown
|
||||
FThreads.invokeInBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO: We don't have a enum for difficulty?
|
||||
int difficulty = qData.getAchievements().getDifficulty();
|
||||
|
||||
|
||||
final int wins = qData.getAchievements().getWin();
|
||||
// Win case
|
||||
if (wonMatch) {
|
||||
@@ -192,7 +198,8 @@ public class QuestWinLose extends ControlWinLose {
|
||||
awardBooster();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -607,7 +614,6 @@ public class QuestWinLose extends ControlWinLose {
|
||||
*
|
||||
*/
|
||||
private void awardBooster() {
|
||||
|
||||
List<PaperCard> cardsWon = null;
|
||||
|
||||
if (qData.getFormat() == null) {
|
||||
|
||||
Reference in New Issue
Block a user