mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix blank line between comments issue (#3407)
* Added failing test to demonstrate issue with dec loading * Prevents empty lines between comments from being interpreted as the start of the sideboard
This commit is contained in:
parent
cf9fdcd09e
commit
bc2cb59c50
2 changed files with 18 additions and 2 deletions
|
|
@ -542,10 +542,11 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
|
|||
}
|
||||
|
||||
// If we have a blank line and it's the _ONLY_ blank line in the paste
|
||||
// and it follows at least one valid card
|
||||
// Then we assume it means to start the sideboard section of the paste.
|
||||
// If we have the word "Sideboard" appear on any line, then that will
|
||||
// also indicate the start of the sideboard.
|
||||
if ((line.isEmpty() && blankLines == 1) || line.startsWith("sideboard")) {
|
||||
if ((line.isEmpty() && blankLines == 1 && okRows > 0) || line.startsWith("sideboard")) {
|
||||
inSideboard = true;
|
||||
continue; // The line isn't actually a card
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue