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();
|
game.getAction().checkGameOverCondition();
|
||||||
else
|
else
|
||||||
game.isGameOver(); // this is synchronized method - it's used to make Game-0 thread see changes made here
|
game.isGameOver(); // this is synchronized method - it's used to make Game-0 thread see changes made here
|
||||||
|
|
||||||
|
playbackControl.onGameStopRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputQueue inputQueue;
|
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() {
|
private void releaseGameThread() {
|
||||||
// just need to run another thread through the barrier... not edt preferrably :)
|
// just need to run another thread through the barrier... not edt preferrably :)
|
||||||
|
|
||||||
fc.getObservedGame().getAction().invoke( new Runnable() {
|
fc.getObservedGame().getAction().invoke( new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user