Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
04e80304
Commit
04e80304
authored
Jul 08, 2014
by
arxanas
Browse files
Fix #184: Deck loader reads 4x cardname correctly.
parent
4e8ba699
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/decklist.cpp
View file @
04e80304
...
@@ -547,14 +547,21 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
...
@@ -547,14 +547,21 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
line
.
remove
(
rx
);
line
.
remove
(
rx
);
line
=
line
.
simplified
();
line
=
line
.
simplified
();
int
i
=
line
.
indexOf
(
' '
);
int
i
=
line
.
indexOf
(
' '
);
int
cardNameStart
=
i
+
1
;
// If the count ends with an 'x', ignore it. For example,
// "4x Storm Crow" will count 4 correctly.
if
(
i
>
0
&&
line
[
i
-
1
]
==
'x'
)
{
i
--
;
}
bool
ok
;
bool
ok
;
int
number
=
line
.
left
(
i
).
toInt
(
&
ok
);
int
number
=
line
.
left
(
i
).
toInt
(
&
ok
);
if
(
!
ok
)
if
(
!
ok
)
continue
;
continue
;
QString
cardName
=
line
.
mid
(
i
+
1
);
QString
cardName
=
line
.
mid
(
cardNameStart
);
// Common differences between cockatrice's card names
// Common differences between cockatrice's card names
// and what's commonly used in decklists
// and what's commonly used in decklists
rx
.
setPattern
(
"’"
);
rx
.
setPattern
(
"’"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment