mirror of https://github.com/OpenTTD/OpenTTD.git
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.
This commit is contained in:
parent
055121df80
commit
979704271b
|
@ -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…
Reference in New Issue