From: Bill R. <ro...@gm...> - 2011-01-25 09:58:08
|
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 |