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:
@@ -443,7 +443,7 @@ protected:
|
||||
this->subspeed = (byte)spd;
|
||||
|
||||
if (!(Type == VEH_TRAIN && _settings_game.vehicle.train_braking_model == TBM_REALISTIC)) {
|
||||
max_speed = min(max_speed, advisory_max_speed);
|
||||
max_speed = std::min(max_speed, advisory_max_speed);
|
||||
}
|
||||
|
||||
int tempmax = max_speed;
|
||||
@@ -460,7 +460,7 @@ protected:
|
||||
}
|
||||
}
|
||||
} else if (this->breakdown_type == BREAKDOWN_LOW_SPEED) {
|
||||
tempmax = min(max_speed, this->breakdown_severity);
|
||||
tempmax = std::min<int>(max_speed, this->breakdown_severity);
|
||||
} else {
|
||||
tempmax = this->cur_speed;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ protected:
|
||||
extern void TrainBrakesOverheatedBreakdown(Vehicle *v);
|
||||
TrainBrakesOverheatedBreakdown(this);
|
||||
}
|
||||
tempmax = max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed);
|
||||
tempmax = std::max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed);
|
||||
}
|
||||
|
||||
/* Enforce a maximum and minimum speed. Normally we would use something like
|
||||
@@ -479,7 +479,7 @@ protected:
|
||||
* threshold for some reason. That makes acceleration fail and assertions
|
||||
* happen in Clamp. So make it explicit that min_speed overrules the maximum
|
||||
* speed by explicit ordering of min and max. */
|
||||
int tempspeed = min(this->cur_speed + ((int)spd >> 8), tempmax);
|
||||
int tempspeed = std::min(this->cur_speed + ((int)spd >> 8), tempmax);
|
||||
|
||||
if (Type == VEH_TRAIN && _settings_game.vehicle.train_braking_model == TBM_REALISTIC && tempspeed > advisory_max_speed && accel.braking != accel.acceleration) {
|
||||
spd = initial_subspeed + accel.braking;
|
||||
@@ -502,7 +502,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
this->cur_speed = max(tempspeed, min_speed);
|
||||
this->cur_speed = std::max(tempspeed, min_speed);
|
||||
|
||||
int scaled_spd = this->GetAdvanceSpeed(this->cur_speed);
|
||||
|
||||
|
Reference in New Issue
Block a user