Fix compilation erorrs

This commit is contained in:
dP
2025-06-30 14:21:06 +05:00
parent f388ddce1f
commit 73cdeac5a1
10 changed files with 26 additions and 26 deletions

View File

@@ -1 +0,0 @@
15.0-beta1 20241224 0 cd0e1fc47de2095cc0642d73ad5d42db35a63d43 1 0

View File

@@ -8,6 +8,7 @@
#include "../company_type.h"
#include "../economy_type.h"
#include "../industry_type.h"
#include "../source_type.h"
#include "../station_type.h"
#include "../town_type.h"
@@ -80,25 +81,24 @@ struct CompanyEvent {
struct CargoDeliveredToIndustry {
Industry *industry;
CargoID cargo_type;
CargoType cargo_type;
uint amount;
const Station *station;
};
struct CargoDeliveredToUnknown {
CargoID cargo_type;
CargoType cargo_type;
uint amount;
const Station *station;
};
struct CargoAccepted {
Company *company;
CargoID cargo_type;
CargoType cargo_type;
uint amount;
const Station *station;
Money profit;
SourceType src_type;
SourceID src;
Source src;
};
struct CompanyMoneyChanged {

View File

@@ -154,7 +154,7 @@ void WriteHouseSpecInfo(JsonWriter &j) {
j.kv("removal_cost", hs->removal_cost);
j.kv("name", hs->building_name);
j.kv("mail_generation", hs->mail_generation);
j.kv("flags", hs->building_flags);
j.kv("flags", hs->building_flags.base());
j.kv("availability", hs->building_availability);
j.kv("enabled", hs->enabled);
j.end_dict();
@@ -181,7 +181,6 @@ void WriteHouseSpecInfo(JsonWriter &j) {
void WriteCargoSpecInfo(JsonWriter &j) {
j.begin_list_with_key("cargo_specs");
char cargo_label[16];
SetDParam(0, 123);
for (const CargoSpec *cs : CargoSpec::Iterate()) {
j.begin_dict();
JKV(j, cs->initial_payment);
@@ -249,7 +248,7 @@ void WriteEngineInfo(JsonWriter &j) {
for (const Engine *e : Engine::Iterate()) {
if (e->type != VEH_TRAIN) continue;
j.begin_dict();
JKV(j, e->index);
JKV(j, e->index.base());
j.kv("name", e->name);
j.kv("cost", e->GetCost());
j.kv("running_cost", e->GetRunningCost());
@@ -257,7 +256,7 @@ void WriteEngineInfo(JsonWriter &j) {
j.begin_dict_with_key("info");
JKV(j, e->info.cargo_type);
JKV(j, e->info.cargo_age_period);
JKV(j, e->info.climates);
JKV(j, e->info.climates.base());
JKV(j, e->info.base_intro.base());
JKV(j, e->info.lifelength.base());
JKV(j, e->info.base_life.base());

View File

@@ -24,7 +24,7 @@ struct LimitsSettings {
class CBRequirement {
public:
CargoID cargo_id;
CargoType cargo_type;
uint32_t from;
uint32_t amount;
uint8_t decay;
@@ -34,9 +34,9 @@ public:
static CBRequirement Parse(const char *name, const char *value, uint8_t index);
CBRequirement(CargoID cargo_id, uint32_t from, uint32_t amount, uint8_t decay,
CBRequirement(CargoType cargo_type, uint32_t from, uint32_t amount, uint8_t decay,
uint8_t index, std::string name)
:cargo_id{cargo_id}, from{from}, amount{amount}, decay{decay},
:cargo_type{cargo_type}, from{from}, amount{amount}, decay{decay},
index{index}, name{name}, has_storage{decay < 100} {}
};

View File

@@ -1141,7 +1141,7 @@ static Money DeliverGoods(int num_pieces, CargoType cargo_type, StationID dest,
if (accepted_total > 0) {
if (accepted_ind != accepted_total)
citymania::Emit(citymania::event::CargoDeliveredToUnknown{cargo_type, accepted_total - accepted_ind, st});
citymania::Emit(citymania::event::CargoAccepted{company, cargo_type, accepted_total, st, profit, src_type, src});
citymania::Emit(citymania::event::CargoAccepted{company, cargo_type, accepted_total, st, profit, src});
}
return profit;

View File

@@ -7,11 +7,11 @@
/** @file rev.cpp Autogenerated file with the revision and such of OpenTTD. */
#include "/home/dp/Downloads/openttd-15.0-beta2/src/stdafx.h"
#include "/home/dp/Downloads/openttd-15.0-beta2/src/core/bitmath_func.hpp"
#include "/home/dp/Downloads/openttd-15.0-beta2/src/rev.h"
#include "${CMAKE_SOURCE_DIR}/src/stdafx.h"
#include "${CMAKE_SOURCE_DIR}/src/core/bitmath_func.hpp"
#include "${CMAKE_SOURCE_DIR}/src/rev.h"
#include "/home/dp/Downloads/openttd-15.0-beta2/src/safeguards.h"
#include "${CMAKE_SOURCE_DIR}/src/safeguards.h"
/**
* Is this version of OpenTTD a release version?

View File

@@ -2946,16 +2946,16 @@ static std::optional<SavePreset> ParseSavePreset(const std::string &str)
if (level != Clamp<int>(level, slf.min_compression, slf.max_compression)) {
/* Invalid compression level, show the error and use default level */
SetDParamStr(0, level_str.c_str());
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL, WL_CRITICAL);
ShowErrorMessage(GetEncodedString(STR_CONFIG_ERROR),
GetEncodedString(STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL, level_str), WL_CRITICAL);
return SavePreset{&slf, slf.default_compression};
}
return SavePreset{&slf, (uint8_t)level};
}
}
SetDParamStr(0, str.c_str());
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_ALGORITHM, WL_CRITICAL);
ShowErrorMessage(GetEncodedString(STR_CONFIG_ERROR),
GetEncodedString(STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_ALGORITHM, str), WL_CRITICAL);
return {};
}

View File

@@ -130,6 +130,7 @@ static auto &GenericSettingTables()
_pathfinding_settings,
_script_settings,
_world_settings,
citymania::_settings,
};
return _generic_setting_tables;
}

View File

@@ -3,12 +3,12 @@ static const SettingVariant _citymania_settings_table[] = {
[post-amble]
};
[templates]
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, SettingFlags({$flags}), $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $range_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for citymania::Settings.$var exceeds storage size");
[defaults]
flags = SF_NONE
flags =
interval = 0
str = STR_NULL
strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT
@@ -19,6 +19,7 @@ str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
range_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION

View File

@@ -516,7 +516,7 @@ static void AdvanceSingleHouseConstruction(TileIndex tile)
ChangePopulation(Town::GetByTile(tile), hs->population);
ResetHouseAge(tile);
if (hs->building_flags & BUILDING_HAS_1_TILE)
if (hs->building_flags.Any(BUILDING_HAS_1_TILE))
citymania::Emit(citymania::event::HouseCompleted{town, tile, house_id, hs});
}
MarkTileDirtyByTile(tile);