Commit 93fa6554 authored by feihuaduo's avatar feihuaduo

修复部分卡转为卡组码错误的问题

parent 7a571530
...@@ -350,13 +350,15 @@ public class Deck implements Parcelable { ...@@ -350,13 +350,15 @@ public class Deck implements Parcelable {
StringBuilder compressedId1 = new StringBuilder(); StringBuilder compressedId1 = new StringBuilder();
StringBuilder compressedId2 = new StringBuilder(); StringBuilder compressedId2 = new StringBuilder();
String ids = id + ""; String ids = id + "";
while (ids.startsWith("0")) { // while (ids.startsWith("0")) {
ids = ids.substring(1); // ids = ids.substring(1);
} // }
int lenght = ids.length(); int lenght = ids.length();
int n=lenght / 2;
for (int i = 0; i < lenght / 2; i++) { if (lenght%2!=0)
n++;
for (int i = 0; i <n; i++) {
int start = i * 2; int start = i * 2;
int end = Math.min(start + 2, lenght); int end = Math.min(start + 2, lenght);
compressedId1.append(getCardIdCompressedId(ids.substring(start, end))); compressedId1.append(getCardIdCompressedId(ids.substring(start, end)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment