Merge branch 'master' into jgrpp
# Conflicts: # src/company_cmd.cpp # src/core/overflowsafe_type.hpp # src/economy.cpp # src/engine_base.h # src/ground_vehicle.cpp # src/group_gui.cpp # src/industry_cmd.cpp # src/industry_gui.cpp # src/newgrf_commons.cpp # src/newgrf_engine.cpp # src/newgrf_industries.cpp # src/newgrf_object.cpp # src/newgrf_roadstop.cpp # src/newgrf_station.cpp # src/rail_gui.cpp # src/road_cmd.h # src/road_gui.cpp # src/saveload/afterload.cpp # src/script/api/script_log.cpp # src/script/api/script_log.hpp # src/settings_gui.cpp # src/settingsgen/settingsgen.cpp # src/station_cmd.cpp # src/station_cmd.h # src/station_gui.cpp # src/strgen/strgen.cpp # src/string_func.h # src/string_type.h # src/table/settings/network_private_settings.ini # src/tests/math_func.cpp # src/textfile_gui.cpp # src/timetable_gui.cpp # src/town_cmd.cpp # src/vehicle.cpp # src/waypoint_cmd.cpp # src/waypoint_cmd.h # src/widgets/dropdown.cpp
This commit is contained in:
@@ -272,7 +272,7 @@ void BaseVehicleListWindow::BuildVehicleList()
|
||||
this->CountOwnVehicles();
|
||||
|
||||
this->vehgroups.RebuildDone();
|
||||
this->vscroll->SetCount(static_cast<int>(this->vehgroups.size()));
|
||||
this->vscroll->SetCount(this->vehgroups.size());
|
||||
}
|
||||
|
||||
static bool GroupCargoFilter(const GUIVehicleGroup* group, const CargoID cid)
|
||||
@@ -1573,21 +1573,21 @@ static bool VehicleAgeSorter(const Vehicle * const &a, const Vehicle * const &b)
|
||||
/** Sort vehicles by this year profit */
|
||||
static bool VehicleProfitThisYearSorter(const Vehicle * const &a, const Vehicle * const &b)
|
||||
{
|
||||
int r = ClampToI32(a->GetDisplayProfitThisYear() - b->GetDisplayProfitThisYear());
|
||||
int r = ClampTo<int32_t>(a->GetDisplayProfitThisYear() - b->GetDisplayProfitThisYear());
|
||||
return (r != 0) ? r < 0 : VehicleNumberSorter(a, b);
|
||||
}
|
||||
|
||||
/** Sort vehicles by last year profit */
|
||||
static bool VehicleProfitLastYearSorter(const Vehicle * const &a, const Vehicle * const &b)
|
||||
{
|
||||
int r = ClampToI32(a->GetDisplayProfitLastYear() - b->GetDisplayProfitLastYear());
|
||||
int r = ClampTo<int32>(a->GetDisplayProfitLastYear() - b->GetDisplayProfitLastYear());
|
||||
return (r != 0) ? r < 0 : VehicleNumberSorter(a, b);
|
||||
}
|
||||
|
||||
/** Sort vehicles by lifetime profit */
|
||||
static bool VehicleProfitLifetimeSorter(const Vehicle * const &a, const Vehicle * const &b)
|
||||
{
|
||||
int r = ClampToI32(a->GetDisplayProfitLifetime() - b->GetDisplayProfitLifetime());
|
||||
int r = ClampTo<int32>(a->GetDisplayProfitLifetime() - b->GetDisplayProfitLifetime());
|
||||
return (r != 0) ? r < 0 : VehicleNumberSorter(a, b);
|
||||
}
|
||||
|
||||
@@ -1640,7 +1640,7 @@ static bool VehicleValueSorter(const Vehicle * const &a, const Vehicle * const &
|
||||
for (u = a; u != nullptr; u = u->Next()) diff += u->value;
|
||||
for (u = b; u != nullptr; u = u->Next()) diff -= u->value;
|
||||
|
||||
int r = ClampToI32(diff);
|
||||
int r = ClampTo<int32_t>(diff);
|
||||
return (r != 0) ? r < 0 : VehicleNumberSorter(a, b);
|
||||
}
|
||||
|
||||
@@ -1654,7 +1654,7 @@ static bool VehicleLengthSorter(const Vehicle * const &a, const Vehicle * const
|
||||
/** Sort vehicles by the time they can still live */
|
||||
static bool VehicleTimeToLiveSorter(const Vehicle * const &a, const Vehicle * const &b)
|
||||
{
|
||||
int r = ClampToI32((a->max_age - a->age) - (b->max_age - b->age));
|
||||
int r = ClampTo<int32_t>((a->max_age - a->age) - (b->max_age - b->age));
|
||||
return (r != 0) ? r < 0 : VehicleNumberSorter(a, b);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user