mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Fix crash when starting AI v. AI match
This commit is contained in:
@@ -193,14 +193,14 @@ public class MatchUtil {
|
||||
}
|
||||
}
|
||||
|
||||
controller.openView(sortedPlayers, humanCount);
|
||||
|
||||
if (humanCount == 0) {
|
||||
playbackControl = new FControlGamePlayback(GuiBase.getInterface(), getGameView());
|
||||
playbackControl.setGame(game);
|
||||
game.subscribeToEvents(playbackControl);
|
||||
}
|
||||
|
||||
controller.openView(sortedPlayers, humanCount);
|
||||
|
||||
// It's important to run match in a different thread to allow GUI inputs to be invoked from inside game.
|
||||
// Game is set on pause while gui player takes decisions
|
||||
game.getAction().invoke(new Runnable() {
|
||||
|
||||
@@ -4,6 +4,9 @@ import forge.control.FControlGamePlayback;
|
||||
import forge.game.Game;
|
||||
import forge.game.phase.PhaseHandler;
|
||||
import forge.interfaces.IGuiBase;
|
||||
import forge.match.MatchUtil;
|
||||
import forge.view.LocalGameView;
|
||||
import forge.view.PlayerView;
|
||||
|
||||
public class InputPlaybackControl extends InputSyncronizedBase implements InputSynchronized {
|
||||
private static final long serialVersionUID = 7979208993306642072L;
|
||||
@@ -23,6 +26,14 @@ public class InputPlaybackControl extends InputSyncronizedBase implements InputS
|
||||
setPause(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalGameView getGameView() {
|
||||
return MatchUtil.getGameView();
|
||||
}
|
||||
@Override
|
||||
public PlayerView getOwner() {
|
||||
return getGameView().getLocalPlayerView();
|
||||
}
|
||||
@Override
|
||||
public IGuiBase getGui() {
|
||||
return gui;
|
||||
|
||||
Reference in New Issue
Block a user