Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/crashlog.cpp # src/fileio.cpp # src/fileio_func.h # src/fios_gui.cpp # src/ini_load.cpp # src/ini_type.h # src/lang/english.txt # src/lang/german.txt # src/lang/korean.txt # src/network/network_client.cpp # src/order_base.h # src/order_cmd.cpp # src/os/windows/win32.cpp # src/road_cmd.cpp # src/saveload/saveload.cpp # src/saveload/saveload.h # src/settings.cpp # src/station_cmd.cpp # src/stdafx.h # src/table/settings.ini # src/tree_cmd.cpp # src/tree_gui.cpp # src/vehicle_base.h # src/video/cocoa/cocoa_v.mm # src/video/cocoa/event.mm # src/video/cocoa/wnd_quartz.mm # src/viewport.cpp # src/widgets/tree_widget.h
This commit is contained in:
@@ -63,7 +63,7 @@ const uint8 _engine_offsets[4] = {
|
||||
lengthof(_orig_rail_vehicle_info) + lengthof(_orig_road_vehicle_info) + lengthof(_orig_ship_vehicle_info),
|
||||
};
|
||||
|
||||
assert_compile(lengthof(_orig_rail_vehicle_info) + lengthof(_orig_road_vehicle_info) + lengthof(_orig_ship_vehicle_info) + lengthof(_orig_aircraft_vehicle_info) == lengthof(_orig_engine_info));
|
||||
static_assert(lengthof(_orig_rail_vehicle_info) + lengthof(_orig_road_vehicle_info) + lengthof(_orig_ship_vehicle_info) + lengthof(_orig_aircraft_vehicle_info) == lengthof(_orig_engine_info));
|
||||
|
||||
const uint EngineOverrideManager::NUM_DEFAULT_ENGINES = _engine_counts[VEH_TRAIN] + _engine_counts[VEH_ROAD] + _engine_counts[VEH_SHIP] + _engine_counts[VEH_AIRCRAFT];
|
||||
|
||||
@@ -663,9 +663,8 @@ void StartupOneEngine(Engine *e, Date aging_date)
|
||||
e->company_avail = 0;
|
||||
e->company_hidden = 0;
|
||||
|
||||
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
|
||||
* of engines in early starting games.
|
||||
* Note: TTDP uses fixed 1922 */
|
||||
/* Vehicles with the same base_intro date shall be introduced at the same time.
|
||||
* Make sure they use the same randomisation of the date. */
|
||||
SavedRandomSeeds saved_seeds;
|
||||
SaveRandomSeeds(&saved_seeds);
|
||||
SetRandomSeed(_settings_game.game_creation.generation_seed ^
|
||||
@@ -674,6 +673,9 @@ void StartupOneEngine(Engine *e, Date aging_date)
|
||||
e->GetGRFID());
|
||||
uint32 r = Random();
|
||||
|
||||
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
|
||||
* of engines in early starting games.
|
||||
* Note: TTDP uses fixed 1922 */
|
||||
e->intro_date = ei->base_intro <= ConvertYMDToDate(_settings_game.game_creation.starting_year + 2, 0, 1) ? ei->base_intro : (Date)GB(r, 0, 9) + ei->base_intro;
|
||||
if (e->intro_date <= _date) {
|
||||
e->age = (aging_date - e->intro_date) >> 5;
|
||||
@@ -681,19 +683,20 @@ void StartupOneEngine(Engine *e, Date aging_date)
|
||||
e->flags |= ENGINE_AVAILABLE;
|
||||
}
|
||||
|
||||
e->reliability_start = GB(r, 16, 14) + 0x7AE0;
|
||||
r = Random();
|
||||
e->reliability_max = GB(r, 0, 14) + 0xBFFF;
|
||||
e->reliability_final = GB(r, 16, 14) + 0x3FFF;
|
||||
RestoreRandomSeeds(saved_seeds);
|
||||
|
||||
r = Random();
|
||||
e->reliability_start = GB(r, 16, 14) + 0x7AE0;
|
||||
e->reliability_max = GB(r, 0, 14) + 0xBFFF;
|
||||
|
||||
r = Random();
|
||||
e->reliability_final = GB(r, 16, 14) + 0x3FFF;
|
||||
e->duration_phase_1 = GB(r, 0, 5) + 7;
|
||||
e->duration_phase_2 = GB(r, 5, 4) + ei->base_life * 12 - 96;
|
||||
e->duration_phase_3 = GB(r, 9, 7) + 120;
|
||||
|
||||
e->reliability_spd_dec = ei->decay_speed << 2;
|
||||
|
||||
RestoreRandomSeeds(saved_seeds);
|
||||
CalcEngineReliability(e);
|
||||
|
||||
/* prevent certain engines from ever appearing. */
|
||||
|
Reference in New Issue
Block a user