Closed beheh closed 8 years ago
It seems to be boiling down to the hardcoded id range check:
@property
def initial_deck(self):
for entity in self.entities:
if 3 < entity.id < 68:
if entity.tags.get(GameTag.CARDTYPE) not in (
CardType.HERO, CardType.HERO_POWER
):
yield entity
That block looks flaky to me - especially in brawls or adventures, where deck sizes may vary (and where no deck list is supplemented from the uploading client). In this case it seems to be choice cards with extra entities.
We probably need some extra logic to filter the cards, or keep a list of ids somewhere.
I don't think there's really a surefire way of getting the deck. And now that I remember, setaside cards will break the algorithm too.
I'm sure we can think of a way - maybe by looking at entities that are in the deck at mulligan time.
Downstream issue: HearthSim/HSReplay.net#43
This log file is missing cards in the initial_deck of player "Red1010". The replay itself contains a lot more cards (a seen in the replay).
I'm testing with the following script:
...and am only getting the following cards for the second player: