Update to 1.10.0-beta1
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user