Merge branch 'master' into jgrpp

# Conflicts:
#	src/3rdparty/fmt/core.h
#	src/command_type.h
#	src/console_cmds.cpp
#	src/core/overflowsafe_type.hpp
#	src/landscape.cpp
#	src/network/network.cpp
#	src/newgrf_object.h
#	src/object_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/vehicle_sl.cpp
#	src/script/api/script_industrytype.cpp
#	src/script/api/script_object.hpp
#	src/script/api/script_town.cpp
#	src/table/object_land.h
#	src/timetable_cmd.cpp
#	src/tree_cmd.cpp
#	src/vehicle_gui.cpp
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2023-01-15 19:28:37 +00:00
64 changed files with 442 additions and 310 deletions

View File

@@ -479,6 +479,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles,
u->cargo_subtype = result.subtype;
if (u->type == VEH_AIRCRAFT) {
Vehicle *w = u->Next();
assert(w != nullptr);
w->refit_cap = std::min<uint16>(w->refit_cap, result.mail_capacity);
w->cargo_cap = result.mail_capacity;
if (w->cargo.TotalCount() > w->refit_cap) w->cargo.Truncate(w->cargo.TotalCount() - w->refit_cap);