Merge branch 'master' into jgrpp

# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/build_vehicle_gui.cpp
#	src/cargotype.cpp
#	src/economy.cpp
#	src/engine_gui.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/linkgraph/refresh.cpp
#	src/linkgraph/refresh.h
#	src/newgrf.cpp
#	src/newgrf_airporttiles.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_station.cpp
#	src/newgrf_station.h
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_func.h
#	src/order_gui.cpp
#	src/pathfinder/pathfinder_type.h
#	src/saveload/afterload.cpp
#	src/subsidy_base.h
#	src/vehicle_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
This commit is contained in:
Jonathan G Rennison
2024-01-11 17:55:16 +00:00
68 changed files with 578 additions and 513 deletions

View File

@@ -1831,11 +1831,11 @@ bool AfterLoadGame()
/* Setting no refit flags to all orders in savegames from before refit in orders were added */
if (IsSavegameVersionBefore(SLV_36)) {
for (Order *order : Order::Iterate()) {
order->SetRefit(CT_NO_REFIT);
order->SetRefit(CARGO_NO_REFIT);
}
for (Vehicle *v : Vehicle::Iterate()) {
v->current_order.SetRefit(CT_NO_REFIT);
v->current_order.SetRefit(CARGO_NO_REFIT);
}
}
@@ -3573,7 +3573,7 @@ bool AfterLoadGame()
/* Make sure added industry cargo slots are cleared */
for (Industry *i : Industry::Iterate()) {
for (size_t ci = 2; ci < lengthof(i->produced_cargo); ci++) {
i->produced_cargo[ci] = CT_INVALID;
i->produced_cargo[ci] = INVALID_CARGO;
i->produced_cargo_waiting[ci] = 0;
i->production_rate[ci] = 0;
i->last_month_production[ci] = 0;
@@ -3583,13 +3583,13 @@ bool AfterLoadGame()
i->this_month_transported[ci] = 0;
}
for (size_t ci = 3; ci < lengthof(i->accepts_cargo); ci++) {
i->accepts_cargo[ci] = CT_INVALID;
i->accepts_cargo[ci] = INVALID_CARGO;
i->incoming_cargo_waiting[ci] = 0;
}
/* Make sure last_cargo_accepted_at is copied to elements for every valid input cargo.
* The loading routine should put the original singular value into the first array element. */
for (size_t ci = 0; ci < lengthof(i->accepts_cargo); ci++) {
if (i->accepts_cargo[ci] != CT_INVALID) {
if (i->accepts_cargo[ci] != INVALID_CARGO) {
i->last_cargo_accepted_at[ci] = i->last_cargo_accepted_at[0];
} else {
i->last_cargo_accepted_at[ci] = 0;