From: Erik V. <ev...@us...> - 2009-10-07 18:56:37
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8689/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Fixed bug that OR did not end if last-running company bought first 6-train and CGR formed. Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** OperatingRound_1856.java 6 Oct 2009 18:34:03 -0000 1.23 --- OperatingRound_1856.java 7 Oct 2009 18:56:22 -0000 1.24 *************** *** 485,491 **** //} ! if (operatingCompany != null) { ! operatingCompanyIndex = companies.indexOf(operatingCompany); ! } for (PublicCompanyI c : companies) { --- 485,491 ---- //} ! //if (operatingCompany != null) { ! // operatingCompanyIndex = companies.indexOf(operatingCompany); ! //} for (PublicCompanyI c : companies) { *************** *** 507,511 **** } else { message = LocalText.getText("CannotOperate", cgr.getName()); ! } } else { message = LocalText.getText("DoesNotForm", cgr.getName()); --- 507,515 ---- } else { message = LocalText.getText("CannotOperate", cgr.getName()); ! // Find the first company that has not yet operated ! // and is not closed. ! while (setNextOperatingCompany(false) ! && operatingCompany.isClosed()); ! } } else { message = LocalText.getText("DoesNotForm", cgr.getName()); *************** *** 515,521 **** operatingCompanyArray = companies.toArray(new PublicCompanyI[0]); - operatingCompanyIndexObject.set(operatingCompanyIndex); ! log.debug ("Next operating company: "+operatingCompany.getName()); } --- 519,530 ---- operatingCompanyArray = companies.toArray(new PublicCompanyI[0]); ! if (operatingCompanyIndex < operatingCompanyArray.length) { ! operatingCompanyIndexObject.set(operatingCompanyIndex); ! log.debug ("Next operating company: "+operatingCompany.getName()); ! } else { ! finishOR(); ! } ! } |