|
From: <ste...@us...> - 2010-08-06 19:52:59
|
Revision: 1370
http://rails.svn.sourceforge.net/rails/?rev=1370&view=rev
Author: stefanfrey
Date: 2010-08-06 19:52:53 +0000 (Fri, 06 Aug 2010)
Log Message:
-----------
Fixed train discard bug in 1856 cgr formation.
Started working on undo of cgr formation.
Modified Paths:
--------------
trunk/18xx/rails/game/move/MoveStack.java
trunk/18xx/rails/game/specific/_1856/CGRFormationRound.java
Modified: trunk/18xx/rails/game/move/MoveStack.java
===================================================================
--- trunk/18xx/rails/game/move/MoveStack.java 2010-08-05 18:53:13 UTC (rev 1369)
+++ trunk/18xx/rails/game/move/MoveStack.java 2010-08-06 19:52:53 UTC (rev 1370)
@@ -99,6 +99,7 @@
public void linkToPreviousMoveSet() {
if (currentMoveSet != null) {
currentMoveSet.linkToPreviousMoveSet();
+ log.debug("Moveset linked to previous one");
} else {
log.warn("No MoveSet open");
}
Modified: trunk/18xx/rails/game/specific/_1856/CGRFormationRound.java
===================================================================
--- trunk/18xx/rails/game/specific/_1856/CGRFormationRound.java 2010-08-05 18:53:13 UTC (rev 1369)
+++ trunk/18xx/rails/game/specific/_1856/CGRFormationRound.java 2010-08-06 19:52:53 UTC (rev 1370)
@@ -642,7 +642,8 @@
}
// Check the trains, autodiscard any excess non-permanent trains
- int trainLimit = cgr.getTrainLimit(gameManager.getCurrentPlayerIndex());
+// int trainLimit = cgr.getTrainLimit(gameManager.getCurrentPlayerIndex());
+ int trainLimit = cgr.getCurrentTrainLimit();
List<TrainI> trains = cgr.getPortfolio().getTrainList();
if (cgr.getNumberOfTrains() > trainLimit) {
ReportBuffer.add("");
@@ -815,8 +816,7 @@
if (train != null) {
- if (action.isForced()) moveStack.linkToPreviousMoveSet();
-
+// if (action.isForced()) moveStack.linkToPreviousMoveSet();
train.moveTo(pool);
ReportBuffer.add(LocalText.getText("CompanyDiscardsTrain",
companyName,
@@ -825,6 +825,8 @@
} else {
cgrHasDiscardedTrains.set(true);
}
+ // new: link always, see above uncommented
+ moveStack.linkToPreviousMoveSet();
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|