From: Erik V. <ev...@us...> - 2010-06-15 20:17:02
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv30779/rails/ui/swing Modified Files: StatusWindow.java Log Message: 1835: fixed train discarding by PR at end of any PR formation round. Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** StatusWindow.java 10 Jun 2010 20:54:31 -0000 1.45 --- StatusWindow.java 15 Jun 2010 20:16:54 -0000 1.46 *************** *** 381,384 **** --- 381,391 ---- if (!(currentRound instanceof StockRound || currentRound instanceof EndOfGameRound)) return; + + // Moved here from StatusWindow_1856. It's getting generic... + if (possibleActions.contains(DiscardTrain.class)) { + immediateAction = possibleActions.getType(DiscardTrain.class).get(0); + return; + } + if (currentRound instanceof TreasuryShareRound) { *************** *** 609,613 **** public boolean processImmediateAction() { ! // No such actions here return true; } --- 616,626 ---- public boolean processImmediateAction() { ! if (immediateAction instanceof DiscardTrain) { ! // Make a local copy and discard the original, ! // so that it's not going to loop. ! DiscardTrain nextAction = (DiscardTrain) immediateAction; ! immediateAction = null; ! gameUIManager.discardTrains (nextAction); ! } return true; } *************** *** 720,722 **** ! } --- 733,735 ---- ! } \ No newline at end of file |