1
0
Fork 0

Fix #10469, 5e14a20: [Script] League Table rating element is a int64 everywhere else

pull/10516/head
SamuXarick 2023-02-12 14:29:18 +00:00 committed by rubidium42
parent aab580e0ac
commit 6eabbaa751
3 changed files with 10 additions and 10 deletions

View File

@ -30,7 +30,7 @@ extern LeagueTablePool _league_table_pool;
**/ **/
struct LeagueTableElement : LeagueTableElementPool::PoolItem<&_league_table_element_pool> { struct LeagueTableElement : LeagueTableElementPool::PoolItem<&_league_table_element_pool> {
LeagueTableID table; ///< Id of the table which this element belongs to 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 CompanyID company; ///< Company Id to show the color blob for or INVALID_COMPANY
std::string text; ///< Text of the element std::string text; ///< Text of the element
std::string score; ///< String representation of the score associated with the element std::string score; ///< String representation of the score associated with the element

View File

@ -16,13 +16,14 @@
#include "../safeguards.h" #include "../safeguards.h"
static const SaveLoad _league_table_elements_desc[] = { static const SaveLoad _league_table_elements_desc[] = {
SLE_VAR(LeagueTableElement, table, SLE_UINT8), SLE_VAR(LeagueTableElement, table, SLE_UINT8),
SLE_VAR(LeagueTableElement, rating, SLE_UINT64), SLE_CONDVAR(LeagueTableElement, rating, SLE_FILE_U64 | SLE_VAR_I64, SL_MIN_VERSION, SLV_LINKGRAPH_EDGES),
SLE_VAR(LeagueTableElement, company, SLE_UINT8), SLE_CONDVAR(LeagueTableElement, rating, SLE_INT64, SLV_LINKGRAPH_EDGES, SL_MAX_VERSION),
SLE_SSTR(LeagueTableElement, text, SLE_STR | SLF_ALLOW_CONTROL), SLE_VAR(LeagueTableElement, company, SLE_UINT8),
SLE_SSTR(LeagueTableElement, score, SLE_STR | SLF_ALLOW_CONTROL), SLE_SSTR(LeagueTableElement, text, SLE_STR | SLF_ALLOW_CONTROL),
SLE_VAR(LeagueTableElement, link.type, SLE_UINT8), SLE_SSTR(LeagueTableElement, score, SLE_STR | SLF_ALLOW_CONTROL),
SLE_VAR(LeagueTableElement, link.target, SLE_UINT32), SLE_VAR(LeagueTableElement, link.type, SLE_UINT8),
SLE_VAR(LeagueTableElement, link.target, SLE_UINT32),
}; };
struct LEAEChunkHandler : ChunkHandler { struct LEAEChunkHandler : ChunkHandler {

View File

@ -344,8 +344,7 @@ enum SaveLoadVersion : uint16 {
SLV_LAST_LOADING_TICK, ///< 301 PR#9693 Store tick of last loading for vehicles. SLV_LAST_LOADING_TICK, ///< 301 PR#9693 Store tick of last loading for vehicles.
SLV_MULTITRACK_LEVEL_CROSSINGS, ///< 302 PR#9931 v13.0 Multi-track level crossings. SLV_MULTITRACK_LEVEL_CROSSINGS, ///< 302 PR#9931 v13.0 Multi-track level crossings.
SLV_NEWGRF_ROAD_STOPS, ///< 303 PR#10144 NewGRF road stops. SLV_NEWGRF_ROAD_STOPS, ///< 303 PR#10144 NewGRF road stops.
SLV_LINKGRAPH_EDGES, ///< 304 PR#10314 Explicitly store link graph edges destination, PR#10471 int64 instead of uint64 league rating
SLV_LINKGRAPH_EDGES, ///< 303 PR#10314 Explicitly store link graph edges destination.
SL_MAX_VERSION, ///< Highest possible saveload version SL_MAX_VERSION, ///< Highest possible saveload version
}; };