Through load: Show vehicle advice message if ignored due to rear in depot

This commit is contained in:
Jonathan G Rennison 2024-08-27 18:02:06 +01:00
parent 4d514f3b19
commit 17a5b7e9a9

View File

@ -1993,6 +1993,13 @@ static void LoadUnloadVehicle(Vehicle *front)
/* Disallow through-load when any part of train is in a depot, to prevent cheating */
if (Train::From(v)->IsInDepot()) {
pull_through_mode = false;
if (_local_company == v->owner) {
SetDParam(0, front->index);
SetDParam(1, order->GetDestination());
AddNewsItem(STR_VEHICLE_LOAD_THROUGH_ABORTED_DEPOT, NT_ADVICE, NF_INCOLOUR | NF_SMALL | NF_VEHICLE_PARAM0,
NR_VEHICLE, front->index,
NR_STATION, order->GetDestination());
}
break;
}
}