From: Mark J S. <kr...@us...> - 2009-01-03 22:50:12
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12300/18xx/rails/game Modified Files: StartRound_1835.java Log Message: Improve Start Packet Handling so that only the left most item from the second available row is for sale, rather than the entire second row. Index: StartRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1835.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** StartRound_1835.java 23 Dec 2008 19:59:06 -0000 1.15 --- StartRound_1835.java 3 Jan 2009 22:49:59 -0000 1.16 *************** *** 71,74 **** --- 71,75 ---- int items = 0; int minRow = 0; + int prevRow = 0; /* *************** *** 86,98 **** } else { row = item.getRow(); if (minRow == 0) minRow = row; if (row == minRow) { // Allow all items in the top row. buyable = true; - items++; } else if (row == minRow + 1 && items == 1) { ! // Allow the first item in the next row if the ! // top row has only one item. ! buyable = true; } } --- 87,103 ---- } else { row = item.getRow(); + if (row > prevRow) { + items = 0; + prevRow = row; + } + items++; if (minRow == 0) minRow = row; if (row == minRow) { // Allow all items in the top row. buyable = true; } else if (row == minRow + 1 && items == 1) { ! // Allow the first item in the next row if the ! // top row has only one item. ! buyable = true; } } |