@@ -48,7 +48,7 @@ EngineOverrideManager _engine_mngr;
|
||||
static Year _year_engine_aging_stops;
|
||||
|
||||
/** Number of engines of each vehicle type in original engine data */
|
||||
const uint8 _engine_counts[4] = {
|
||||
const uint8_t _engine_counts[4] = {
|
||||
lengthof(_orig_rail_vehicle_info),
|
||||
lengthof(_orig_road_vehicle_info),
|
||||
lengthof(_orig_ship_vehicle_info),
|
||||
@@ -56,7 +56,7 @@ const uint8 _engine_counts[4] = {
|
||||
};
|
||||
|
||||
/** Offset of the first engine of each vehicle type in original engine data */
|
||||
const uint8 _engine_offsets[4] = {
|
||||
const uint8_t _engine_offsets[4] = {
|
||||
0,
|
||||
lengthof(_orig_rail_vehicle_info),
|
||||
lengthof(_orig_rail_vehicle_info) + lengthof(_orig_road_vehicle_info),
|
||||
@@ -150,7 +150,7 @@ bool Engine::IsEnabled() const
|
||||
* This is the GRF providing the Action 3.
|
||||
* @return GRF ID of the associated NewGRF.
|
||||
*/
|
||||
uint32 Engine::GetGRFID() const
|
||||
uint32_t Engine::GetGRFID() const
|
||||
{
|
||||
const GRFFile *file = this->GetGRF();
|
||||
return file == nullptr ? 0 : file->grfid;
|
||||
@@ -223,7 +223,7 @@ bool Engine::CanPossiblyCarryCargo() const
|
||||
* @param mail_capacity returns secondary cargo (mail) capacity of aircraft
|
||||
* @return Capacity
|
||||
*/
|
||||
uint Engine::DetermineCapacity(const Vehicle *v, uint16 *mail_capacity) const
|
||||
uint Engine::DetermineCapacity(const Vehicle *v, uint16_t *mail_capacity) const
|
||||
{
|
||||
assert(v == nullptr || this->index == v->engine_type);
|
||||
if (mail_capacity != nullptr) *mail_capacity = 0;
|
||||
@@ -241,7 +241,7 @@ uint Engine::DetermineCapacity(const Vehicle *v, uint16 *mail_capacity) const
|
||||
/* Check the refit capacity callback if we are not in the default configuration, or if we are using the new multiplier algorithm. */
|
||||
if (HasBit(this->info.callback_mask, CBM_VEHICLE_REFIT_CAPACITY) &&
|
||||
(new_multipliers || default_cargo != cargo_type || (v != nullptr && v->cargo_subtype != 0))) {
|
||||
uint16 callback;
|
||||
uint16_t callback;
|
||||
if (this->refit_capacity_values != nullptr) {
|
||||
const EngineRefitCapacityValue *caps = this->refit_capacity_values.get();
|
||||
while (true) {
|
||||
@@ -296,8 +296,8 @@ uint Engine::DetermineCapacity(const Vehicle *v, uint16 *mail_capacity) const
|
||||
|
||||
/* Apply multipliers depending on cargo- and vehicletype. */
|
||||
if (new_multipliers || (this->type != VEH_SHIP && default_cargo != cargo_type)) {
|
||||
uint16 default_multiplier = new_multipliers ? 0x100 : CargoSpec::Get(default_cargo)->multiplier;
|
||||
uint16 cargo_multiplier = CargoSpec::Get(cargo_type)->multiplier;
|
||||
uint16_t default_multiplier = new_multipliers ? 0x100 : CargoSpec::Get(default_cargo)->multiplier;
|
||||
uint16_t cargo_multiplier = CargoSpec::Get(cargo_type)->multiplier;
|
||||
capacity *= cargo_multiplier;
|
||||
if (extra_mail_cap > 0) {
|
||||
uint mail_multiplier = CargoSpec::Get(CT_MAIL)->multiplier;
|
||||
@@ -494,7 +494,7 @@ DateDelta Engine::GetLifeLengthInDays() const
|
||||
* Get the range of an aircraft type.
|
||||
* @return Range of the aircraft type in tiles or 0 if unlimited range.
|
||||
*/
|
||||
uint16 Engine::GetRange() const
|
||||
uint16_t Engine::GetRange() const
|
||||
{
|
||||
switch (this->type) {
|
||||
case VEH_AIRCRAFT:
|
||||
@@ -573,7 +573,7 @@ void EngineOverrideManager::ResetToDefaultMapping()
|
||||
* If dynnamic_engines is disabled, all newgrf share the same ID scope identified by INVALID_GRFID.
|
||||
* @return The engine ID if present, or INVALID_ENGINE if not.
|
||||
*/
|
||||
EngineID EngineOverrideManager::GetID(VehicleType type, uint16 grf_local_id, uint32 grfid)
|
||||
EngineID EngineOverrideManager::GetID(VehicleType type, uint16_t grf_local_id, uint32_t grfid)
|
||||
{
|
||||
EngineID index = 0;
|
||||
for (const EngineIDMapping &eid : *this) {
|
||||
@@ -672,7 +672,7 @@ void CalcEngineReliability(Engine *e, bool new_month)
|
||||
re = Engine::Get(re->info.variant_id);
|
||||
}
|
||||
|
||||
uint32 age = re->age;
|
||||
uint32_t age = re->age;
|
||||
if (new_month && re->index > e->index && age != INT32_MAX) age++; /* parent variant's age has not yet updated. */
|
||||
|
||||
/* Check for early retirement */
|
||||
@@ -736,7 +736,7 @@ void SetYearEngineAgingStops()
|
||||
* @param aging_date The date used for age calculations.
|
||||
* @param seed Random seed.
|
||||
*/
|
||||
void StartupOneEngine(Engine *e, Date aging_date, const YearMonthDay &aging_ymd, uint32 seed, Date no_introduce_after_date)
|
||||
void StartupOneEngine(Engine *e, Date aging_date, const YearMonthDay &aging_ymd, uint32_t seed, Date no_introduce_after_date)
|
||||
{
|
||||
const EngineInfo *ei = &e->info;
|
||||
|
||||
@@ -753,7 +753,7 @@ void StartupOneEngine(Engine *e, Date aging_date, const YearMonthDay &aging_ymd,
|
||||
ei->base_intro.base() ^
|
||||
e->type ^
|
||||
e->GetGRFID());
|
||||
uint32 r = Random();
|
||||
uint32_t r = Random();
|
||||
|
||||
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
|
||||
* of engines in early starting games.
|
||||
@@ -832,7 +832,7 @@ void StartupEngines()
|
||||
no_introduce_after_date = ConvertYMDToDate(_settings_game.vehicle.no_introduce_vehicles_after, 0, 1) - 1;
|
||||
}
|
||||
|
||||
uint32 seed = Random();
|
||||
uint32_t seed = Random();
|
||||
|
||||
for (Engine *e : Engine::Iterate()) {
|
||||
StartupOneEngine(e, aging_date, aging_ymd, seed, no_introduce_after_date);
|
||||
@@ -951,7 +951,7 @@ static CompanyID GetPreviewCompany(Engine *e)
|
||||
/* For trains the cargomask has no useful meaning, since you can attach other wagons */
|
||||
CargoTypes cargomask = e->type != VEH_TRAIN ? GetUnionOfArticulatedRefitMasks(e->index, true) : ALL_CARGOTYPES;
|
||||
|
||||
int32 best_hist = -1;
|
||||
int32_t best_hist = -1;
|
||||
for (const Company *c : Company::Iterate()) {
|
||||
if (c->block_preview == 0 && !HasBit(e->preview_asked, c->index) &&
|
||||
c->old_economy[0].performance_history > best_hist) {
|
||||
@@ -1050,7 +1050,7 @@ void ClearEnginesHiddenFlagOfCompany(CompanyID cid)
|
||||
* @param text Unused.
|
||||
* @return The cost of this operation or an error.
|
||||
*/
|
||||
CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
Engine *e = Engine::GetIfValid(GB(p2, 0, 31));
|
||||
if (e == nullptr || _current_company >= MAX_COMPANIES) return CMD_ERROR;
|
||||
@@ -1074,7 +1074,7 @@ CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32
|
||||
* @param text unused
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
Engine *e = Engine::GetIfValid(p1);
|
||||
if (e == nullptr || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR;
|
||||
@@ -1095,7 +1095,7 @@ CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
* @param text unused
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdEngineCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdEngineCtrl(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
EngineID engine_id = (EngineID)p1;
|
||||
@@ -1269,7 +1269,7 @@ static bool IsUniqueEngineName(const char *name)
|
||||
* @param text the new name or an empty string when resetting to the default
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdRenameEngine(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdRenameEngine(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
Engine *e = Engine::GetIfValid(p1);
|
||||
if (e == nullptr) return CMD_ERROR;
|
||||
|
Reference in New Issue
Block a user