Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/aircraft_cmd.cpp # src/blitter/32bpp_anim.cpp # src/cargopacket.cpp # src/cheat_gui.cpp # src/company_cmd.cpp # src/company_gui.cpp # src/core/pool_func.hpp # src/date.cpp # src/economy.cpp # src/error_gui.cpp # src/ground_vehicle.cpp # src/ground_vehicle.hpp # src/group_gui.cpp # src/industry_cmd.cpp # src/lang/dutch.txt # src/lang/french.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/mcf.cpp # src/network/network_content.cpp # src/network/network_server.cpp # src/network/network_udp.cpp # src/newgrf_engine.cpp # src/newgrf_station.cpp # src/order_cmd.cpp # src/order_gui.cpp # src/pathfinder/follow_track.hpp # src/pathfinder/yapf/yapf_common.hpp # src/saveload/saveload.cpp # src/settings_gui.cpp # src/station_cmd.cpp # src/station_kdtree.h # src/string_func.h # src/table/settings.ini # src/tgp.cpp # src/timetable_cmd.cpp # src/timetable_gui.cpp # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train_cmd.cpp # src/train_gui.cpp # src/tree_gui.cpp # src/tunnelbridge_cmd.cpp # src/vehicle.cpp # src/vehicle_gui.cpp # src/video/sdl2_v.cpp # src/video/sdl_v.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/viewport_sprite_sorter_sse4.cpp # src/window.cpp
This commit is contained in:
@@ -669,8 +669,8 @@ bool AfterLoadGame()
|
||||
int dx = TileX(t) - TileX(st->train_station.tile);
|
||||
int dy = TileY(t) - TileY(st->train_station.tile);
|
||||
assert(dx >= 0 && dy >= 0);
|
||||
st->train_station.w = max<uint>(st->train_station.w, dx + 1);
|
||||
st->train_station.h = max<uint>(st->train_station.h, dy + 1);
|
||||
st->train_station.w = std::max<uint>(st->train_station.w, dx + 1);
|
||||
st->train_station.h = std::max<uint>(st->train_station.h, dy + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,12 +843,7 @@ bool AfterLoadGame()
|
||||
_settings_game.linkgraph.distribution_default = DT_MANUAL;
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(SLV_105)) {
|
||||
extern int32 _old_ending_year_slv_105; // in date.cpp
|
||||
_settings_game.game_creation.ending_year = _old_ending_year_slv_105 - 1;
|
||||
} else if (IsSavegameVersionBefore(SLV_ENDING_YEAR)) {
|
||||
/* Ending year was a GUI setting before SLV_105, was removed in revision 683b65ee1 (svn r14755). */
|
||||
/* This also converts scenarios, both when loading them into the editor, and when starting a new game. */
|
||||
if (IsSavegameVersionBefore(SLV_ENDING_YEAR)) {
|
||||
_settings_game.game_creation.ending_year = DEF_END_YEAR;
|
||||
}
|
||||
|
||||
@@ -2745,7 +2740,7 @@ bool AfterLoadGame()
|
||||
uint per_proc = _me[t].m7;
|
||||
_me[t].m7 = GB(_me[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6);
|
||||
SB(_m[t].m3, 5, 1, 0);
|
||||
SB(_me[t].m6, 2, 6, min(per_proc, 63));
|
||||
SB(_me[t].m6, 2, 6, std::min(per_proc, 63U));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3001,7 +2996,7 @@ bool AfterLoadGame()
|
||||
_settings_game.pf.reverse_at_signals = IsSavegameVersionBefore(SLV_100) || (_settings_game.pf.wait_oneway_signal != 255 && _settings_game.pf.wait_twoway_signal != 255 && _settings_game.pf.wait_for_pbs_path != 255);
|
||||
|
||||
for (Train *t : Train::Iterate()) {
|
||||
_settings_game.vehicle.max_train_length = max<uint8>(_settings_game.vehicle.max_train_length, CeilDiv(t->gcache.cached_total_length, TILE_SIZE));
|
||||
_settings_game.vehicle.max_train_length = std::max<uint8>(_settings_game.vehicle.max_train_length, CeilDiv(t->gcache.cached_total_length, TILE_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3127,7 +3122,7 @@ bool AfterLoadGame()
|
||||
* Set it to the reliability of the front engine or the maximum, whichever is lower. */
|
||||
const Engine *e = Engine::Get(v->engine_type);
|
||||
v->reliability_spd_dec = e->reliability_spd_dec;
|
||||
v->reliability = min(v->First()->reliability, e->reliability);
|
||||
v->reliability = std::min(v->First()->reliability, e->reliability);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3158,7 +3153,7 @@ bool AfterLoadGame()
|
||||
switch(v->type) {
|
||||
case VEH_AIRCRAFT:
|
||||
if (v->breakdown_type == BREAKDOWN_AIRCRAFT_SPEED && v->breakdown_severity == 0) {
|
||||
v->breakdown_severity = max(1, min(v->vcache.cached_max_speed >> 4, 255));
|
||||
v->breakdown_severity = std::max(1, std::min(v->vcache.cached_max_speed >> 4, 255));
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user