Sure enough, the code didn't work with brand new cards lacking SetInfo.

This commit is contained in:
jendave
2011-08-06 16:01:47 +00:00
parent 73c98b0e33
commit 90b531bd8d
5 changed files with 55 additions and 44 deletions

View File

@@ -2301,11 +2301,13 @@ public class GameAction {
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
card.setRandomSetCode();
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
if (n > 1)
card.setRandomPicture(generator.nextInt(n));
if (!card.getCurSetCode().equals("")) {
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
if (n > 1)
card.setRandomPicture(generator.nextInt(n));
card.setImageFilename(CardUtil.buildFilename(card));
card.setImageFilename(CardUtil.buildFilename(card));
}
//System.out.println("human random number:" + card.getRandomPicture());
//}
@@ -2335,11 +2337,13 @@ public class GameAction {
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
card.setRandomSetCode();
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
if (n > 1)
card.setRandomPicture(generator.nextInt(n));
if (!card.getCurSetCode().equals("")) {
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
if (n > 1)
card.setRandomPicture(generator.nextInt(n));
card.setImageFilename(CardUtil.buildFilename(card));
card.setImageFilename(CardUtil.buildFilename(card));
}
AllZone.Computer_Library.add(card);