mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 13:31:41 +00:00

Previously statistics were stored in global variables, now it is a part of saved_game. With this saved_game now finally represent the contents of a safefile as it was intended to, without needing to fill the statistics part in some global variable. (See also #4672 ) In particular now no longer have to manually reset the statistics as random parts of the code, it gets reset along with the saved_game object. Also it is now in theroy possible for multiple saved_game objects to exist. Statistics was split in two objects, the statistics_record which only contains the data, and statistics_t, which provides methods to modify statistics during a game (to get cleaner dependencies) This fixes multiple related bugs with statistics in replays: - #4133 (stats not bring reset when loading a replay) - #4133 (duplicate entry for current scenario in replay) - #4441 (wrong stats at the beginning of a replay) And issues with statistics being lost for non-host players when reloading a game in (online) mp (no ticket for that one found).