Through load: Show vehicle advice message if ignored due to passengers

This commit is contained in:
Jonathan G Rennison 2024-08-27 18:05:36 +01:00
parent 17a5b7e9a9
commit f016e54ac3
2 changed files with 6 additions and 0 deletions

View File

@ -1988,6 +1988,11 @@ static void LoadUnloadVehicle(Vehicle *front)
/* Passengers may not be through-loaded */
if (v->cargo_cap > 0 && IsCargoInClass(v->cargo_type, CC_PASSENGERS)) {
pull_through_mode = false;
if (_local_company == v->owner) {
SetDParam(0, front->index);
AddNewsItem(STR_VEHICLE_LOAD_THROUGH_NOT_ALLOWED_PASSENGERS, NT_ADVICE, NF_INCOLOUR | NF_SMALL | NF_VEHICLE_PARAM0,
NR_VEHICLE, front->index);
}
break;
}
/* Disallow through-load when any part of train is in a depot, to prevent cheating */

View File

@ -1634,6 +1634,7 @@ STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SELL_VEL :{CREAM}Heading
STR_VEHICLE_LOAD_THROUGH_ABORTED_INSUFFICIENT_TRACK :{WHITE}{VEHICLE}: through load aborted due to insufficient track at {STATION}
STR_VEHICLE_LOAD_THROUGH_ABORTED_DEPOT :{WHITE}{VEHICLE}: through load aborted due to depot at {STATION}
STR_VEHICLE_LOAD_THROUGH_NOT_ALLOWED_PASSENGERS :{WHITE}{VEHICLE}: through load is not allowed for passengers
STR_RUNNING :{LTBLUE}Running