From: brett l. <wak...@gm...> - 2008-02-19 02:21:50
|
On Feb 18, 2008 2:52 PM, Michał Bażyński <ba...@tl...> wrote: > > first of, how to reproduce the bug: > > In 18AL, conduct a start round in such a way that there's only one > bidder for the last private company. you can have every one make a > single bid on a different private for example, then buy Tusc. Result: > the application hangs. > > Reason: > in StockRound_1830.java in setPossibleActions() there's a check if > there are any unsold companies left before each item is looked at to see > if it is just auto-sold as there's only one bidder for it. > > Solution: > add the extra check if any unsold privates remain after looking at > them all. > > Attached is a patch doing just that. > > (My first patch, if I should be doing something differently please tell me.) > > best regards, > mike > > ? patch.txt > Index: StartRound_1830.java > =================================================================== > RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v > retrieving revision 1.11 > diff -u -r1.11 StartRound_1830.java > --- StartRound_1830.java 13 Feb 2008 19:59:03 -0000 1.11 > +++ StartRound_1830.java 18 Feb 2008 22:43:38 -0000 > @@ -143,7 +143,13 @@ > } > > } > - > + > + /* > + * it is possible that the last unsold item was sold in the above loop. > + * go to next round if that happened > + */ > + if (StartPacket.getStartPacket().areAllSold()) return false; > + > if (possibleActions.isEmpty()) { > numPasses.add(1); > if (auctionItemState.getObject() == null) { > Applied. Thanks! ---Brett. |