Skip to content

Commit

Permalink
Fix a decoding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed May 25, 2017
1 parent a4bec2a commit fa46ade
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Changelog (http://keepachangelog.com/)

### Fixed
- Fix a decoding bug

[Unreleased]: https://github.com/HearthSim/npm-deckstrings/compare/v0.1.0...HEAD
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function decode(deckstring: string): DeckDefinition {

const cards = [];
for (let i = 1; i <= 3; i++) {
for (let i = 0, c = reader.nextVarint(); i < c; i++) {
for (let j = 0, c = reader.nextVarint(); j < c; j++) {
cards.push([reader.nextVarint(), (i === 1 || i === 2) ? i : reader.nextVarint()]);
}
}
Expand Down

0 comments on commit fa46ade

Please sign in to comment.