Fix: reverse train direction command did not validate the given vehicle properly (#9947)

You could give a wagon in the chain to reverse (which makes no
functional sense ofc). In result, only parts of the vehicle were
reversing, leading to weird crashes.
pull/428/head
Patric Stout 2 years ago committed by GitHub
parent 055121df80
commit 979704271b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1936,6 +1936,7 @@ CommandCost CmdReverseTrainDirection(DoCommandFlag flags, VehicleID veh_id, bool
}
} else {
/* turn the whole train around */
if (!v->IsPrimaryVehicle()) return CMD_ERROR;
if ((v->vehstatus & VS_CRASHED) || v->breakdown_ctr != 0) return CMD_ERROR;
if (flags & DC_EXEC) {

Loading…
Cancel
Save