AS vs AI playback control bugfix (end paused game)

This commit is contained in:
Maxmtg
2013-05-30 13:53:45 +00:00
parent 92ed246e83
commit 406a87a347
2 changed files with 9 additions and 0 deletions

View File

@@ -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;

View File

@@ -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() {