mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
AS vs AI playback control bugfix (end paused game)
This commit is contained in:
@@ -375,6 +375,8 @@ public enum FControl {
|
||||
game.getAction().checkGameOverCondition();
|
||||
else
|
||||
game.isGameOver(); // this is synchronized method - it's used to make Game-0 thread see changes made here
|
||||
|
||||
playbackControl.onGameStopRequested();
|
||||
}
|
||||
|
||||
private InputQueue inputQueue;
|
||||
|
||||
@@ -134,8 +134,15 @@ public class FControlGamePlayback extends IGameEventVisitor.Base<Void> {
|
||||
}
|
||||
|
||||
|
||||
public void onGameStopRequested() {
|
||||
paused.set(false);
|
||||
if ( gameThreadPauser.getNumberWaiting() != 0)
|
||||
releaseGameThread();
|
||||
}
|
||||
|
||||
private void releaseGameThread() {
|
||||
// just need to run another thread through the barrier... not edt preferrably :)
|
||||
|
||||
fc.getObservedGame().getAction().invoke( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Reference in New Issue
Block a user