mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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) {
|
if (humanCount == 0) {
|
||||||
playbackControl = new FControlGamePlayback(GuiBase.getInterface(), getGameView());
|
playbackControl = new FControlGamePlayback(GuiBase.getInterface(), getGameView());
|
||||||
playbackControl.setGame(game);
|
playbackControl.setGame(game);
|
||||||
game.subscribeToEvents(playbackControl);
|
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.
|
// 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 is set on pause while gui player takes decisions
|
||||||
game.getAction().invoke(new Runnable() {
|
game.getAction().invoke(new Runnable() {
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import forge.control.FControlGamePlayback;
|
|||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.phase.PhaseHandler;
|
import forge.game.phase.PhaseHandler;
|
||||||
import forge.interfaces.IGuiBase;
|
import forge.interfaces.IGuiBase;
|
||||||
|
import forge.match.MatchUtil;
|
||||||
|
import forge.view.LocalGameView;
|
||||||
|
import forge.view.PlayerView;
|
||||||
|
|
||||||
public class InputPlaybackControl extends InputSyncronizedBase implements InputSynchronized {
|
public class InputPlaybackControl extends InputSyncronizedBase implements InputSynchronized {
|
||||||
private static final long serialVersionUID = 7979208993306642072L;
|
private static final long serialVersionUID = 7979208993306642072L;
|
||||||
@@ -23,6 +26,14 @@ public class InputPlaybackControl extends InputSyncronizedBase implements InputS
|
|||||||
setPause(false);
|
setPause(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalGameView getGameView() {
|
||||||
|
return MatchUtil.getGameView();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public PlayerView getOwner() {
|
||||||
|
return getGameView().getLocalPlayerView();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public IGuiBase getGui() {
|
public IGuiBase getGui() {
|
||||||
return gui;
|
return gui;
|
||||||
|
|||||||
Reference in New Issue
Block a user