Update of /cvsroot/rails/18xx/rails/game/action
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv30729/rails/game/action
Modified Files:
BuyTrain.java
Log Message:
Fixed holes that allowed not specifying the exchanged train in a train exchange action.
Index: BuyTrain.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/action/BuyTrain.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** BuyTrain.java 30 Apr 2010 09:35:36 -0000 1.20
--- BuyTrain.java 13 May 2010 09:51:32 -0000 1.21
***************
*** 216,220 ****
} else {
b.append(" for any amount");
- if (pricePaid > 0) b.append(" - paid: ").append(Bank.format(pricePaid));
}
if (specialProperty != null) {
--- 216,219 ----
***************
*** 222,233 ****
}
if (isForExchange()) {
! b.append(forcedExchange ? " (forced exchange)" : " (exchanged)");
}
! if (presidentMustAddCash)
b.append(" must add cash ").append(Bank.format(presidentCashToAdd));
! else if (presidentMayAddCash)
b.append(" may add cash up to ").append(
Bank.format(presidentCashToAdd));
! if (pricePaid > 0) b.append(" - paid: ").append(Bank.format(pricePaid));
return b.toString();
--- 221,237 ----
}
if (isForExchange()) {
! b.append(forcedExchange ? " (forced exchange)" : " (exchange)");
}
! if (presidentMustAddCash) {
b.append(" must add cash ").append(Bank.format(presidentCashToAdd));
! } else if (presidentMayAddCash) {
b.append(" may add cash up to ").append(
Bank.format(presidentCashToAdd));
! }
! if (acted) {
! b.append(" - paid: ").append(Bank.format(pricePaid));
! if (addedCash > 0) b.append(" pres.cash added: "+Bank.format(addedCash));
! if (exchangedTrain != null) b.append(" exchanged for "+exchangedTrain.getName()+"-train");
! }
return b.toString();
|