Update to 1.10.0-beta1

This commit is contained in:
dP
2019-10-31 22:24:28 +03:00
parent b84a475e14
commit 599ccf0c2b
1470 changed files with 354219 additions and 16795 deletions

View File

@@ -17,7 +17,6 @@
#include "string_func.h"
#include "strings_func.h"
#include "table/strings.h"
#include "core/sort_func.hpp"
#include "debug.h"
#include "safeguards.h"
@@ -79,9 +78,9 @@ int8 SaveHighScoreValue(const Company *c)
}
/** Sort all companies given their performance */
static int CDECL HighScoreSorter(const Company * const *a, const Company * const *b)
static bool HighScoreSorter(const Company * const &a, const Company * const &b)
{
return (*b)->old_economy[0].performance_history - (*a)->old_economy[0].performance_history;
return b->old_economy[0].performance_history < a->old_economy[0].performance_history;
}
/**
@@ -98,7 +97,7 @@ int8 SaveHighScoreValueNetwork()
/* Sort all active companies with the highest score first */
FOR_ALL_COMPANIES(c) cl[count++] = c;
QSortT(cl, count, &HighScoreSorter);
std::sort(std::begin(cl), std::begin(cl) + count, HighScoreSorter);
{
uint i;
@@ -129,7 +128,7 @@ void SaveToHighScore()
{
FILE *fp = fopen(_highscore_file, "wb");
if (fp != NULL) {
if (fp != nullptr) {
uint i;
HighScore *hs;
@@ -159,7 +158,7 @@ void LoadFromHighScore()
memset(_highscore_table, 0, sizeof(_highscore_table));
if (fp != NULL) {
if (fp != nullptr) {
uint i;
HighScore *hs;