From: Erik V. <eri...@xs...> - 2011-02-04 18:42:11
|
Fixed bug #3165621: 1889 port token could not be laid. Tile laying code has been generally cleaned up and simplified. Some other (unrelated) minor bugs have been found and fixed. Cases where both a regular and a special property-originating tile can be laid on the same hex now work correctly (such as in 1899 hex G10 in the saved file provided with the above bug). Please let me know if any unwanted change in behaviour of tile laying processes are found. I have done quite some testing (and found some more bugs in that process, still to fix), but it's not really possible to check for all potential side effects of changing such old code. > -----Oorspronkelijk bericht----- > Van: Bill Rosgen [mailto:ro...@gm...] > Verzonden: dinsdag 25 januari 2011 11:42 > Aan: Development list for Rails: an 18xx game > Onderwerp: Re: [Rails-devel] 1889 Regression: private B and laying the port > tile? > > Hi Phil, > > I encounter this error when playing a new game created in the trunk code. If > it works for others, it's probably some sort of misconfiguration on my end. > As far as I can tell I have the latest version of the source, but I'm not very > familiar with Eclipse. > > Bill > > On 2011-01-25, at 18:23 , Phil Davies wrote: > > > Bill, > > > > I've just checked this against the trunk code checked out today and I > > don't have this problem. > > > > Are you using a saved game made with 1.4? There has been a change to > > the tile manifest to 1889 (tile 440 was broken) so it's likely that > > your saved game won't work with the trunk code because of this change. > > Starting a new game from scratch and using B's power worked okay for > > me. > > > > Phil > > > > > > On 25 January 2011 09:57, Bill Rosgen <ro...@gm...> wrote: > >> Hello, > >> > >> Hopefully this is the right place to post this. I've recently checked the > source out of svn and have been playing around with rails (so that I can play > 18EU on my laptop with small screen). When playing 1889 I run into a > problem that the owner of private B cannot lay the port tile, but only if I use > the code I've checked out of svn -- version 1.4 works correctly. > >> > >> Specifically, when the user clicks on a map space where he can lay the > port tile there's a NullPointerException thrown from line 106 of > UpgradesPanel.populate(). It looks like the call to layTile.getTileColours() > returns a null pointer for at least one of the tiles in the list (I assume it's the > port tile, since it's a special tile, so the constructed of LayTile is called for the > SPECIAL_PROPERTY case where LayTile.tileColours does not get set. > >> > >> I have a savegame that can be used as a test-case, but I encounter this > problem literally anytime the owner of private B attempts to lay the port tile > (which can be as early as the first tile lay), so I'm not sure it's worth sending > out. > >> > >> I am able to get around the problem my testing that > layTile.getTileColours() returns non-null, but as I'm not familiar with the code, > I'm not sure if that will break anything else. Specifically, if I change lines 104- > 115 of UpgradesPanel.populate() to the following: > >> > >> for (TileI tile : tiles) { > >> // Skip if not allowed in LayTile > >> if (layTile.getTileColours() != null && > >> layTile.getTileColours().get(tile.getColourName()) < 1) continue; > >> > >> // special check: does the tile increase the colour number? > >> // this avoids that a special tile lay down or equalgrades existing > tiles > >> // TODO EV: I'm not sure if this is a necessary precaution. > >> if (layTile.getTileColours() != null && > >> !layTile.isTileColourAllowed(tile.getColourName())) continue; > >> > >> if (!orUIManager.tileUpgrades.contains(tile)) > >> orUIManager.tileUpgrades.add(tile); > >> } > >> > >> then it seems that the private power works correctly. > >> > >> I'd send a patch, but I'm not convinced that UpgradesPanel is the right > place to make this change and I'm also not sure that the bug isn't some > artifact of me misconfiguring Eclipse. > >> > >> Thanks, > >> Bill Rosgen > >> > >> > >> --------------------------------------------------------------------- > >> --------- Special Offer-- Download ArcSight Logger for FREE (a $49 > >> USD value)! > >> Finally, a world-class log management solution at an even better price- > free! > >> Download using promo code Free_Logger_4_Dev2Dev. Offer expires > >> February 28th, so secure your free ArcSight Logger TODAY! > >> http://p.sf.net/sfu/arcsight-sfd2d > >> _______________________________________________ > >> Rails-devel mailing list > >> Rai...@li... > >> https://lists.sourceforge.net/lists/listinfo/rails-devel > >> > > > > ---------------------------------------------------------------------- > > -------- Special Offer-- Download ArcSight Logger for FREE (a $49 USD > > value)! > > Finally, a world-class log management solution at an even better price-free! > > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > > February 28th, so secure your free ArcSight Logger TODAY! > > http://p.sf.net/sfu/arcsight-sfd2d > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ---------------------------------------------------------------------------- -- > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |