Closed CWO333 closed 11 months ago
To confirm, were you in "Session" or "Always" mode? And thank you very much for this feedback 👍
I'm currently in Session mode.
I just tested a change to fix this and make the code look somewhat clean. I don't program in C/C++ but this seems benign enough that it won't hurt anything.
For GameEnd -> Game Won instead of
if (stats[current.playlist].streak < 0)
{
always.streak = 0;
session.streak = 0;
stats[current.playlist].streak = 0;
always_gm[current.playlist].streak = 0;
}
You could use
always.streak = std::max(0, always.streak);
session.streak = std::max(0, session.streak);
stats[current.playlist].streak = std::max(0, stats[current.playlist].streak);
always_gm[current.playlist].streak = std::max(0, always_gm[current.playlist].streak);
For GameEnd -> Game Lost and GameDestroyed
always.streak = std::min(0, always.streak);
session.streak = std::min(0, session.streak);
stats[current.playlist].streak = std::min(0, stats[current.playlist].streak);
always_gm[current.playlist].streak = std::min(0, always_gm[current.playlist].streak);
Thanks, I'll try that when I have a moment :)
So I just did a test and thought about it. The Streak is correct since it is based on a "Session" save.
If you change playlists you stay in the session until you restart the game.
I tangle my brushes... Is it the heat xD
Yes so the streak is sence whatever happens return to 0 when we lose and we are positive, and the same for the reverse, hmm.
I will test your code in the coming days I think.
And indeed there is a problem because it comes back to zero one game after only.
Basically this is why all 4 streaks need to be evaluated independently to see if they need to be reset since all 4 are being increased or decreased. They could still be a mixed combination of winning and losing streaks and still be correct. To be cleaner I just removed the if and turned them into min/max functions with 0.
Hey @CWO333 , thanks for your feedback
It was indeed a bug from the streak calculation, this has been fixed in https://github.com/Lyliya/RocketStats/pull/34 thanks to your suggestion
Thank you
I have been tracking down an issue with the streak counter and I found the cause. When in game, I would start a new session and play a few games on one playlist. Let's say I win 2 games so my streak is +2. Then I switch playlists and I lose the next game. My streak should be -1 but it's not, it's +1. This is because only the streak counter for the current playlist is checked. Another example, I start a new game after being on a 3 game winning streak last time I played. My streak variables should be:
Let's say I lose my first game.
GameEnd -> Game Lost says:
Since stats[current.playlist].streak == 0 my variables look like this:
When they should look like this: