Bug 473191 - High score stats stack when selecting Restart Game instead of New.
Summary: High score stats stack when selecting Restart Game instead of New.
Status: RESOLVED FIXED
Alias: None
Product: knavalbattle
Classification: Applications
Component: general (show other bugs)
Version: 2.1.21123
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Roney Gomes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-09 05:43 UTC by Sienile
Modified: 2023-08-23 14:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sienile 2023-08-09 05:43:43 UTC
SUMMARY
Played a few single player games and used the Restart Game button to avoid the extra click of selecting Single Player again. Each time I noticed my hits and misses counter on the high score screen was going up. It reached 46 hits and 231 misses after 5 games. (Total possible is 10\90.) Using the New button resets the stats.


STEPS TO REPRODUCE
1. Play several games.
2. Achieve any high score position.
3. Watch stats increase each time.

OBSERVED RESULT
Stats continue to increase.

EXPECTED RESULT
Stats would start fresh after hitting Restart Game.

SOFTWARE/OS VERSIONS
Windows: not checked
macOS: not checked
Linux/KDE Plasma: Ubuntu 22.04.3
KDE Plasma Version: irrelevant
KDE Frameworks Version: irrelevant
Qt Version: irrelevant
Comment 1 Bug Janitor Service 2023-08-09 21:34:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/games/knavalbattle/-/merge_requests/14
Comment 2 Albert Astals Cid 2023-08-23 14:43:21 UTC
Git commit ab26cb76dda1c82efd4089f43dd7b8153d4574c1 by Albert Astals Cid.
Committed on 23/08/2023 at 16:39.
Pushed by aacid into branch 'master'.

Reset stats on restarting a game

M  +2    -0    src/playfield.cpp
M  +8    -0    src/stats.cpp
M  +4    -2    src/stats.h

https://invent.kde.org/games/knavalbattle/-/commit/ab26cb76dda1c82efd4089f43dd7b8153d4574c1
Comment 3 Albert Astals Cid 2023-08-23 14:46:31 UTC
Git commit 9fba33485f9654078318b01bfb8007c9966f5666 by Albert Astals Cid.
Committed on 23/08/2023 at 16:45.
Pushed by aacid into branch 'release/23.08'.

Reset stats on restarting a game
(cherry picked from commit ab26cb76dda1c82efd4089f43dd7b8153d4574c1)

M  +2    -0    src/playfield.cpp
M  +8    -0    src/stats.cpp
M  +4    -2    src/stats.h

https://invent.kde.org/games/knavalbattle/-/commit/9fba33485f9654078318b01bfb8007c9966f5666