From: Stefan F. <ste...@us...> - 2012-02-01 12:38:56
|
rails/game/StockRound.java | 3 readme.txt | 21 - test/data/bugs/1830_sellPresidency.rails |binary test/data/bugs/1830_sellPresidency.report | 408 ++++++++++++++++++++++++++++++ version.number | 2 5 files changed, 417 insertions(+), 17 deletions(-) New commits: commit 113af81105b505713fac94237b72735dc2a11564 Author: Stefan Frey <ste...@we...> Date: Wed Feb 1 07:39:30 2012 +0100 added test case for fixed sell presidency bug (cherry picked from commit a7c513c2ba686d4b9e542491bac68a7d3718dc37) diff --git a/test/data/bugs/1830_sellPresidency.rails b/test/data/bugs/1830_sellPresidency.rails new file mode 100644 index 0000000..c3fd78c Binary files /dev/null and b/test/data/bugs/1830_sellPresidency.rails differ diff --git a/test/data/bugs/1830_sellPresidency.report b/test/data/bugs/1830_sellPresidency.report new file mode 100644 index 0000000..f2ed980 --- /dev/null +++ b/test/data/bugs/1830_sellPresidency.report @@ -0,0 +1,408 @@ +GameIs,1830 +PlayerIs,1,Palmiro +PlayerIs,2,Danilo +PlayerIs,3,Giancarlo +PlayerIs,4,Glauco +PlayerIs,5,Roberto +PlayerCash,480 +BankHas,9600 +StartOfPhase,2 +BankSizeIs,9600 +StartOfInitialRound +HasPriority,Palmiro +BID_ITEM_LOG,Palmiro,165,C&A,315 +BID_ITEM_LOG,Danilo,75,D&H,405 +BID_ITEM_LOG,Giancarlo,115,M&H,365 +BID_ITEM_LOG,Glauco,45,C&StL,435 +BID_ITEM_LOG,Roberto,170,C&A,310 +BID_ITEM_LOG,Palmiro,80,D&H,235 +BID_ITEM_LOG,Danilo,120,M&H,285 +BID_ITEM_LOG,Giancarlo,50,C&StL,315 +BuysItemFor,Glauco,SVNRR,20 +TO_AUCTION,C&StL +BID_ITEM_LOG,Glauco,55,C&StL,405 +BID_ITEM_LOG,Giancarlo,60,C&StL,305 +PASSES,Glauco +BuysItemFor,Giancarlo,C&StL,60 +TO_AUCTION,D&H +BID_ITEM_LOG,Danilo,85,D&H,275 +BID_ITEM_LOG,Palmiro,90,D&H,225 +PASSES,Danilo +BuysItemFor,Palmiro,D&H,90 +TO_AUCTION,M&H +BID_ITEM_LOG,Giancarlo,125,M&H,295 +BID_ITEM_LOG,Danilo,130,M&H,350 +BID_ITEM_LOG,Giancarlo,135,M&H,285 +BID_ITEM_LOG,Danilo,140,M&H,340 +PASSES,Giancarlo +BuysItemFor,Danilo,M&H,140 +TO_AUCTION,C&A +BID_ITEM_LOG,Palmiro,175,C&A,215 +BID_ITEM_LOG,Roberto,180,C&A,300 +BID_ITEM_LOG,Palmiro,185,C&A,205 +BID_ITEM_LOG,Roberto,190,C&A,290 +BID_ITEM_LOG,Palmiro,195,C&A,195 +BID_ITEM_LOG,Roberto,200,C&A,280 +BID_ITEM_LOG,Palmiro,210,C&A,180 +BID_ITEM_LOG,Roberto,215,C&A,265 +BID_ITEM_LOG,Palmiro,220,C&A,170 +BID_ITEM_LOG,Roberto,225,C&A,255 +BID_ITEM_LOG,Palmiro,230,C&A,160 +PASSES,Roberto +BuysItemFor,Palmiro,C&A,230 +ALSO_GETS,Palmiro,CERT_NAME,PRR,10 +PASSES,Roberto +PASSES,Danilo +BuysItemFor,Giancarlo,B&O,220 +ALSO_GETS,Giancarlo,PRES_CERT_NAME,B&O,20 +Has,Palmiro,160 +Has,Danilo,340 +Has,Giancarlo,200 +Has,Glauco,460 +Has,Roberto,480 +StartStockRound,1 +HasPriority,Glauco +START_COMPANY_LOG,Glauco,NYNH,76,152,2,20,BANK +START_COMPANY_LOG,Roberto,C&O,76,152,2,20,BANK +START_COMPANY_LOG,Palmiro,PRR,76,152,2,20,BANK +BUY_SHARE_LOG,Danilo,10,B&O,IPO,100 +PASSES,Giancarlo +BUY_SHARE_LOG,Glauco,10,NYNH,IPO,76 +BUY_SHARE_LOG,Roberto,10,C&O,IPO,76 +PASSES,Palmiro +BUY_SHARE_LOG,Danilo,10,B&O,IPO,100 +BUY_SHARE_LOG,Giancarlo,10,B&O,IPO,100 +BUY_SHARE_LOG,Glauco,10,NYNH,IPO,76 +BUY_SHARE_LOG,Roberto,10,C&O,IPO,76 +Autopasses,Palmiro +BUY_SHARE_LOG,Danilo,10,B&O,IPO,100 +FloatsWithCash,B&O,1000 +BUY_SHARE_LOG,Giancarlo,10,NYNH,IPO,76 +BUY_SHARE_LOG,Glauco,10,NYNH,IPO,76 +FloatsWithCash,NYNH,760 +BUY_SHARE_LOG,Roberto,10,C&O,IPO,76 +Autopasses,Palmiro +PASSES,Danilo +PASSES,Giancarlo +BUY_SHARE_LOG,Glauco,10,NYNH,IPO,76 +BUY_SHARE_LOG,Roberto,10,C&O,IPO,76 +FloatsWithCash,C&O,760 +Autopasses,Palmiro +PASSES,Danilo +Autopasses,Giancarlo +Autopasses,Glauco +Autopasses,Roberto + +END_SR,1 +Has,B&O,1000 +Has,C&O,760 +Has,NYNH,760 +Has,Palmiro,8 +Has,Danilo,40 +Has,Giancarlo,24 +Has,Glauco,4 +Has,Roberto,24 +START_OR,1.1 +ReceivesFor,Glauco,5,SVNRR +ReceivesFor,Giancarlo,10,C&StL +ReceivesFor,Palmiro,15,D&H +ReceivesFor,Danilo,20,M&H +ReceivesFor,Palmiro,25,C&A +ReceivesFor,Giancarlo,30,B&O + +CompanyOperates,B&O,Giancarlo +LaysTileAtFor,B&O,57,J14,SW,80 +LAYS_TOKEN_ON,B&O,J14,40 +CompanyDoesNotPayDividend,B&O +PRICE_MOVES_LOG,B&O,100,G1,90,F1 +BuysTrain,B&O,2,IPO,80 +PrivateCloses,B&O +FirstTrainBought,2 +BuysTrain,B&O,2,IPO,80 +BuysTrain,B&O,2,IPO,80 + +CompanyOperates,NYNH,Glauco +LaysTileAt,NYNH,56,F20,NW +CompanyDoesNotPayDividend,NYNH +PRICE_MOVES_LOG,NYNH,76,G4,71,F4 +BuysTrain,NYNH,2,IPO,80 +BuysTrain,NYNH,2,IPO,80 + +CompanyOperates,C&O,Roberto +LaysTileAt,C&O,8,G5,W +CompanyDoesNotPayDividend,C&O +PRICE_MOVES_LOG,C&O,76,G4,71,F4 +BuysTrain,C&O,2,IPO,80 +All 2-trains are sold out, 3-trains now available + +EndOfOperatingRound,1.1 +ORWorthIncrease,Palmiro,1.1,40 +ORWorthIncrease,Danilo,1.1,-10 +ORWorthIncrease,Giancarlo,1.1,-215 +ORWorthIncrease,Glauco,1.1,-25 +ORWorthIncrease,Roberto,1.1,-30 +Has,B&O,640 +Has,C&O,680 +Has,NYNH,600 +Has,Palmiro,48 +Has,Danilo,60 +Has,Giancarlo,64 +Has,Glauco,9 +Has,Roberto,24 +StartStockRound,2 +HasPriority,Palmiro +SELL_SHARE_LOG,Palmiro,10,PRR,76 +PRICE_MOVES_LOG,PRR,76,G4,71,G5 +PASSES,Danilo +PASSES,Giancarlo +PASSES,Glauco +PASSES,Roberto +BUY_SHARE_LOG,Palmiro,10,C&O,IPO,76 +PASSES,Danilo +PASSES,Giancarlo +PASSES,Glauco +PASSES,Roberto +PASSES,Palmiro + +END_SR,2 +Has,B&O,640 +Has,C&O,680 +Has,NYNH,600 +Has,Palmiro,48 +Has,Danilo,60 +Has,Giancarlo,64 +Has,Glauco,9 +Has,Roberto,24 +START_OR,2.1 +ReceivesFor,Glauco,5,SVNRR +ReceivesFor,Giancarlo,10,C&StL +ReceivesFor,Palmiro,15,D&H +ReceivesFor,Danilo,20,M&H +ReceivesFor,Palmiro,25,C&A + +CompanyOperates,B&O,Giancarlo +LaysTileAtFor,B&O,9,I17,W,80 +CompanyRevenue,B&O,140 +CompanyWithholds,B&O,140 +PRICE_MOVES_LOG,B&O,90,F1,82,E1 +BuysTrain,B&O,3,IPO,180 +FirstTrainBought,3 +StartOfPhase,3 +BuysPrivateFromFor,B&O,C&StL,Giancarlo,80 + +CompanyOperates,NYNH,Glauco +LaysTileAt,NYNH,57,E19,NW +CompanyRevenue,NYNH,50 +CompanyPaysOutFull,NYNH,50 +Payout,Giancarlo,5,1,10 +Payout,Glauco,30,6,10 +PRICE_MOVES_LOG,NYNH,71,F4,76,G4 +BuysPrivateFromFor,NYNH,SVNRR,Glauco,40 + +CompanyOperates,C&O,Roberto +LaysTileAt,C&O,8,G3,NW +CompanyRevenue,C&O,70 +CompanyPaysOutFull,C&O,70 +Payout,Palmiro,7,1,10 +Payout,Roberto,42,6,10 +PRICE_MOVES_LOG,C&O,71,F4,76,G4 +BuysTrain,C&O,3,IPO,180 + +EndOfOperatingRound,2.1 +ORWorthIncrease,Palmiro,2.1,52 +ORWorthIncrease,Danilo,2.1,-4 +ORWorthIncrease,Giancarlo,2.1,36 +ORWorthIncrease,Glauco,2.1,85 +ORWorthIncrease,Roberto,2.1,72 +Has,B&O,440 +Has,C&O,500 +Has,NYNH,560 +Has,Palmiro,95 +Has,Danilo,80 +Has,Giancarlo,159 +Has,Glauco,84 +Has,Roberto,66 +StartStockRound,3 +HasPriority,Danilo +BUY_SHARE_LOG,Danilo,10,C&O,IPO,76 +BUY_SHARE_LOG,Giancarlo,10,C&O,IPO,76 +BUY_SHARE_LOG,Glauco,10,C&O,IPO,76 +PASSES,Roberto +BUY_SHARE_LOG,Palmiro,10,PRR,IPO,76 +PASSES,Danilo +BUY_SHARE_LOG,Giancarlo,10,NYNH,IPO,76 +SELL_SHARES_LOG,Giancarlo,2,10,20,NYNH,152 +PRICE_MOVES_LOG,NYNH,76,G4,67,G6 +PASSES,Glauco +PASSES,Roberto +SELL_SHARE_LOG,Palmiro,10,C&O,76 +PRICE_MOVES_LOG,C&O,76,G4,71,G5 +BUY_SHARE_LOG,Palmiro,10,PRR,IPO,76 +PASSES,Danilo +BUY_SHARE_LOG,Giancarlo,10,PRR,Pool,71 +SELL_SHARE_LOG,Giancarlo,10,PRR,71 +PRICE_MOVES_LOG,PRR,71,G5,67,G6 +PASSES,Glauco +PASSES,Roberto +SELL_SHARE_LOG,Palmiro,10,PRR,67 +PRICE_MOVES_LOG,PRR,67,G6,67,G7 +BUY_SHARE_LOG,Palmiro,10,NYNH,Pool,67 +PASSES,Danilo +BUY_SHARE_LOG,Giancarlo,10,B&O,IPO,100 +PASSES,Glauco +PASSES,Roberto +PASSES,Palmiro +PASSES,Danilo +PASSES,Giancarlo + +END_SR,3 +Has,B&O,440 +Has,C&O,500 +Has,NYNH,560 +Has,Palmiro,19 +Has,Danilo,4 +Has,Giancarlo,59 +Has,Glauco,8 +Has,Roberto,66 +START_OR,3.1 +ReceivesFor,NYNH,5,SVNRR +ReceivesFor,B&O,10,C&StL +ReceivesFor,Palmiro,15,D&H +ReceivesFor,Danilo,20,M&H +ReceivesFor,Palmiro,25,C&A + +CompanyOperates,B&O,Giancarlo +LaysTileAt,B&O,14,J14,NW +CompanyRevenue,B&O,210 +CompanyWithholds,B&O,210 +PRICE_MOVES_LOG,B&O,82,E1,76,D1 + +CompanyOperates,C&O,Roberto +LaysTileAt,C&O,2,G7,SE +CompanyRevenue,C&O,110 +CompanyPaysOutFull,C&O,110 +Payout,Roberto,66,6,10 +Payout,Glauco,11,1,10 +Payout,Giancarlo,11,1,10 +Payout,Danilo,11,1,10 +Payout,C&O,11,1,10 +PRICE_MOVES_LOG,C&O,71,G5,76,H5 + +CompanyOperates,NYNH,Glauco +LaysTileAt,NYNH,14,E19,NW +LAYS_TOKEN_ON,NYNH,E19,40 +CompanyRevenue,NYNH,90 +CompanyPaysOutFull,NYNH,90 +Payout,Palmiro,9,1,10 +Payout,Glauco,54,6,10 +Payout,NYNH,9,1,10 +PRICE_MOVES_LOG,NYNH,67,G6,71,H6 + +EndOfOperatingRound,3.1 +ORWorthIncrease,Palmiro,3.1,53 +ORWorthIncrease,Danilo,3.1,18 +ORWorthIncrease,Giancarlo,3.1,-8 +ORWorthIncrease,Glauco,3.1,94 +ORWorthIncrease,Roberto,3.1,96 +Has,B&O,660 +Has,C&O,511 +Has,NYNH,534 +Has,Palmiro,68 +Has,Danilo,35 +Has,Giancarlo,70 +Has,Glauco,73 +Has,Roberto,132 +START_OR,3.2 +ReceivesFor,NYNH,5,SVNRR +ReceivesFor,B&O,10,C&StL +ReceivesFor,Palmiro,15,D&H +ReceivesFor,Danilo,20,M&H +ReceivesFor,Palmiro,25,C&A + +CompanyOperates,C&O,Roberto +LaysTileAt,C&O,8,H8,NW +CompanyRevenue,C&O,110 +CompanyPaysOutFull,C&O,110 +Payout,Roberto,66,6,10 +Payout,Glauco,11,1,10 +Payout,Danilo,11,1,10 +Payout,Giancarlo,11,1,10 +Payout,C&O,11,1,10 +PRICE_MOVES_LOG,C&O,76,H5,82,I5 + +CompanyOperates,B&O,Giancarlo +LaysTileAt,B&O,53,I15,SW +CompanyRevenue,B&O,250 +CompanyPaysOutFull,B&O,250 +Payout,Danilo,75,3,10 +Payout,Giancarlo,100,4,10 +PRICE_MOVES_LOG,B&O,76,D1,82,E1 + +CompanyOperates,NYNH,Glauco +LaysTileAt,NYNH,9,F18,SW +CompanyRevenue,NYNH,90 +CompanyPaysOutFull,NYNH,90 +Payout,Palmiro,9,1,10 +Payout,Glauco,54,6,10 +Payout,NYNH,9,1,10 +PRICE_MOVES_LOG,NYNH,71,H6,75,I6 +BuysTrain,NYNH,3,IPO,180 +BuysTrain,NYNH,3,IPO,180 + +EndOfOperatingRound,3.2 +ORWorthIncrease,Palmiro,3.2,53 +ORWorthIncrease,Danilo,3.2,130 +ORWorthIncrease,Giancarlo,3.2,141 +ORWorthIncrease,Glauco,3.2,95 +ORWorthIncrease,Roberto,3.2,102 +Has,B&O,670 +Has,C&O,522 +Has,NYNH,188 +Has,Palmiro,117 +Has,Danilo,141 +Has,Giancarlo,181 +Has,Glauco,138 +Has,Roberto,198 +StartStockRound,4 +HasPriority,Glauco +SELL_SHARE_LOG,Glauco,10,C&O,82 +PRICE_MOVES_LOG,C&O,82,I5,75,I6 +SELL_SHARES_LOG,Glauco,4,10,40,NYNH,300 +PRICE_MOVES_LOG,NYNH,75,I6,70,I7 +START_COMPANY_LOG,Glauco,NYC,82,164,2,20,BANK +SELL_SHARE_LOG,Roberto,10,C&O,75 +PRICE_MOVES_LOG,C&O,75,I6,70,I7 +BUY_SHARE_LOG,Roberto,10,NYNH,Pool,70 +SELL_SHARE_LOG,Palmiro,10,NYNH,70 +BUY_SHARE_LOG,Palmiro,10,PRR,Pool,67 +SELL_SHARES_LOG,Danilo,3,10,30,B&O,246 +PRICE_MOVES_LOG,B&O,82,E1,66,E4 +SELL_SHARE_LOG,Danilo,10,C&O,70 +START_COMPANY_LOG,Danilo,Erie,76,152,2,20,BANK +BUY_SHARE_LOG,Giancarlo,10,NYNH,Pool,70 +BUY_SHARE_LOG,Glauco,10,PRR,Pool,67 +SELL_SHARE_LOG,Glauco,10,PRR,67 +PRICE_MOVES_LOG,PRR,67,G7,67,G8 +BUY_SHARE_LOG,Roberto,10,NYNH,IPO,76 +BUY_SHARE_LOG,Palmiro,10,B&O,Pool,66 +SELL_SHARE_LOG,Palmiro,10,B&O,66 +PRICE_MOVES_LOG,B&O,66,E4,62,E5 +BUY_SHARE_LOG,Danilo,10,Erie,IPO,76 +BUY_SHARE_LOG,Giancarlo,10,NYC,IPO,82 +SELL_SHARE_LOG,Giancarlo,10,NYC,82 +PRICE_MOVES_LOG,NYC,82,G3,76,G4 +BUY_SHARE_LOG,Glauco,10,NYC,Pool,76 +PASSES,Roberto +BUY_SHARE_LOG,Palmiro,10,PRR,IPO,76 +FloatsWithCash,PRR,760 +BUY_SHARE_LOG,Danilo,10,Erie,IPO,76 +BUY_SHARE_LOG,Giancarlo,10,NYNH,Pool,70 +SELL_SHARE_LOG,Glauco,10,NYNH,70 +IS_NOW_PRES_OF,Roberto,NYNH +PASSES,Roberto +PASSES,Palmiro +BUY_SHARE_LOG,Danilo,10,NYNH,Pool,70 +PASSES,Giancarlo +PASSES,Glauco +SELL_SHARES_LOG,Roberto,2,10,20,NYNH,140 +IS_NOW_PRES_OF,Giancarlo,NYNH commit 1b472e8aae62cf0a68d9966f41d61345481c494e Author: Stefan Frey <ste...@we...> Date: Wed Feb 1 13:23:07 2012 +0100 Updated readme.txt for 1.6.2 diff --git a/readme.txt b/readme.txt index f26c93f..a496617 100644 --- a/readme.txt +++ b/readme.txt @@ -1,18 +1,9 @@ -Rails release 1.6.1: +Rails release 1.6.2: -A maintenance release for the 1.6.x branch. +A bug-fix release for the 1.6.x branch. -Contributors: Frederick Weld, Erik Vos -Bugs reported by Bill Probst. +Contributor: Erik Vos +Bug reported by Bill Probst. -List of bugs fixed and further changes: -- Enforced that the DynamicReportWindow stays on top during time warp -- Added background map for 1889 (courtesy of Frederick Weld) -- Fixed autosave functionality (handling of 18xx_autosave.xxx files) -- Fixed retrieval of default game options (if options pane was not opened) -- Fixed 1856 background map's mini-map (Windsor area) -- Enforce selling over-limit shares first -- Fixed wrong price of 6 train (630 => 600) in 18TN - -Note: To show a background map, the option has to be switched on in Configuration => Map/Report => Display background map. -Background maps are only available for 1856, 1889, 18EU, 18GA (incl. Cotton Port) and 18AL so far. +Single bug fixed: +A sole presidency share could not be dumped. \ No newline at end of file commit f86c3aa27724e73aa6c904ef9a4612ff43c93b0f Author: Stefan Frey <ste...@we...> Date: Wed Feb 1 13:21:37 2012 +0100 Changed version number to 1.6.2 diff --git a/version.number b/version.number index d54f51c..70672b0 100644 --- a/version.number +++ b/version.number @@ -1,5 +1,5 @@ #Property file that contains version number and the develop indicator -version=1.6.1 +version=1.6.2 # the following string "@DEVELOP@ is replaced by an empty string in the release version # this is done automatically by ant develop=@DEVELOP@ \ No newline at end of file commit 2c91b6c26f7f7117534477f7b08f5f220dd25daa Author: Erik Vos <eri...@xs...> Date: Wed Feb 1 13:20:43 2012 +0100 Fixed: a sole presidency share could not be dumped. This is hand-picked from the commit of Erik Vos: a26c98646bc379d17a48121a74b49e8cc54cea05 diff --git a/rails/game/StockRound.java b/rails/game/StockRound.java index 037d2cc..1446fb5 100644 --- a/rails/game/StockRound.java +++ b/rails/game/StockRound.java @@ -471,11 +471,12 @@ public class StockRound extends Round { /* Allow for different share units (as in 1835) */ for (int shareSize = 1; shareSize <= 4; shareSize++) { number = shareCountPerUnit[shareSize]; - if (number == 0) continue; // If you can dump a presidency, you may sell additional single shares that you don't own if (shareSize == 1) number += extraSingleShares; + if (number == 0) continue; + /* In some games (1856), a just bought share may not be sold */ // This code ignores the possibility of different share units if ((Boolean)gameManager.getGameParameter(GameDef.Parm.NO_SALE_OF_JUST_BOUGHT_CERT) |