FIXED bug in CardStorageReader to support numbers in card names w/ lazy card loading

Borrowing 100,000 Arrows was the driver test case
This commit is contained in:
leriomaggio
2021-08-04 15:59:31 +01:00
parent 58b2a070ed
commit a9c1c01a20

View File

@@ -138,10 +138,13 @@ public class CardStorageReader {
if (c == '\'') {
continue;
}
if (c < 'a' || c > 'z') {
if ((c < 'a' || c > 'z') && (c < '0' || c > '9')) {
if (charIndex > 0 && chars[charIndex - 1] == '_') {
continue;
}
// Comma separator in numbers: "Borrowing 100,000 Arrows"
if ((c == ',') && (charIndex > 0) && (chars[charIndex-1] >= '0' || chars[charIndex-1] <= '9'))
continue;
c = '_';
}
chars[charIndex++] = c;