New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opponents cards appear in wrong order, Cards created do not show up until the second one is created #1406
Comments
Happens randomly or is it consistent? |
Wait... they are sorted alphabetically.. what? |
Card ordering appears to be random? Happened for my first game only. Now it looks fine: http://i.imgur.com/5PziLeJ.jpg |
Generated card issue also doesn't appear to be consistent, unless it's Ysera only: http://i.imgur.com/S6Flkvg.jpg Feel free to close this issue as something that might happen only the first time? I'll reopen if I can reproduce. |
Alphabetical ordering is occurring again: http://i.imgur.com/pP2i8tM.jpg |
Does it fix itself or is that consistent throughout the game? |
It's consistent for that game, but then the next two or so games seem to be fine. I can't seem to find a pattern as to when it occurs. |
To add, I am on Windows 10 64-bit. I'm trying to trace through the code to see if I can figure out what's wrong, but I'm getting lost. Is the variable that contains an opponent's deck is in GameV2.cs? Is it the GameStats? This is a bit far fetched, but Is it possible that the order is wrong because I don't have a deck list for my opponent? I think that could happen if the Deck type from the replay and the in-progress game is shared. |
And the opponent card list is this one |
Is the order for this List guranteed? https://github.com/Epix37/Hearthstone-Deck-Tracker/blob/master/Hearthstone%20Deck%20Tracker/Utility/Helper.cs#L219 If this is out of order it could be sorted by Type or Name first. From my mostly Java background this happens often. Type is Minion and Spell? I'll see if I can play some more games and see if that happens, although looking at this line it seems that type can be "Hero Power" so I'm not sure it would even show up? https://github.com/Epix37/Hearthstone-Deck-Tracker/blob/master/Hearthstone%20Deck%20Tracker/Hearthstone/Card.cs#L130 |
I have not changed The only thing I did change is that I pass it |
Here's a screenshot where it's not in alphabetical order: It fixed itself next opponent's turn, but then it came back: http://i.imgur.com/dMIrbT1.jpg |
The first one looks like "order of play" and type. Weird stuff... |
The order of play isn't actually accurate though. And it was fine on my turn. |
I think I may have already accidentally stated the solution. Changing it back from |
|
Thanks for fixing this so quickly. So the problem ended up being a place where sorting wasn't being done? |
The problem was: when I created the card lists that are supposed to be displayed, I created new card instances instead of loading them from the database. In theory that's totally fine becuase, when e.g. the name is then accessed, the cards loads the data automatically. However, that does not happen for the cost. So when sorting the cards by cost before sorting them by name (which is the order it needs to happen in), the cost would not be loaded yet and therefore just be 0. |
fixed with pre-release v0.10.18 |
Using the latest pre-release version.
Screenshot: http://i.imgur.com/v7zefcD.jpg
Living Roots appears in the middle of the opponent's cards played.
Laughing Sister was created, then the Emerald Drake at the bottom. The Laughing Sister only showed up after the Emerald Drake was created.
The text was updated successfully, but these errors were encountered: