From 70d5683e534a0fdd0f83b7c820ad2b912dd285e8 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Sun, 12 Feb 2023 14:29:18 +0000 Subject: [PATCH] Fix #10469, 5e14a20: [Script] League Table rating element is a int64 everywhere else --- src/league_base.h | 2 +- src/saveload/league_sl.cpp | 2 +- src/saveload/saveload.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/league_base.h b/src/league_base.h index 8a70db4ca2..6195d2c3ee 100644 --- a/src/league_base.h +++ b/src/league_base.h @@ -30,7 +30,7 @@ extern LeagueTablePool _league_table_pool; **/ struct LeagueTableElement : LeagueTableElementPool::PoolItem<&_league_table_element_pool> { LeagueTableID table; ///< Id of the table which this element belongs to - uint64 rating; ///< Value that determines ordering of elements in the table (higher=better) + int64 rating; ///< Value that determines ordering of elements in the table (higher=better) CompanyID company; ///< Company Id to show the color blob for or INVALID_COMPANY std::string text; ///< Text of the element std::string score; ///< String representation of the score associated with the element diff --git a/src/saveload/league_sl.cpp b/src/saveload/league_sl.cpp index 122d7ccee5..d7ab5d309a 100644 --- a/src/saveload/league_sl.cpp +++ b/src/saveload/league_sl.cpp @@ -17,7 +17,7 @@ static const SaveLoad _league_table_elements_desc[] = { SLE_VAR(LeagueTableElement, table, SLE_UINT8), - SLE_VAR(LeagueTableElement, rating, SLE_UINT64), + SLE_VAR(LeagueTableElement, rating, SLE_FILE_U64 | SLE_VAR_I64), SLE_VAR(LeagueTableElement, company, SLE_UINT8), SLE_SSTR(LeagueTableElement, text, SLE_STR | SLF_ALLOW_CONTROL), SLE_SSTR(LeagueTableElement, score, SLE_STR | SLF_ALLOW_CONTROL), diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index 16352cc749..fa8ea38766 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -340,9 +340,10 @@ enum SaveLoadVersion : uint16 { SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 v12.0-RC1 Store travel time in the linkgraph. SLV_DOCK_DOCKINGTILES, ///< 298 PR#9578 All tiles around docks may be docking tiles. SLV_REPAIR_OBJECT_DOCKING_TILES, ///< 299 PR#9594 v12.0 Fixing issue with docking tiles overlapping objects. + SLV_U64_TICK_COUNTER, ///< 300 PR#10035 Make _tick_counter 64bit to avoid wrapping. SLV_LAST_LOADING_TICK, ///< 301 PR#9693 Store tick of last loading for vehicles. - SLV_MULTITRACK_LEVEL_CROSSINGS, ///< 302 PR#9931 Multi-track level crossings. + SLV_MULTITRACK_LEVEL_CROSSINGS, ///< 302 PR#9931 v13.0 Multi-track level crossings. SL_MAX_VERSION, ///< Highest possible saveload version };