Changeset - r26314:b43ac5d245f9
[Not reviewed]
master
0 1 0
Patric Stout - 23 months ago 2022-07-09 10:28:20
truebrain@openttd.org
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.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -1936,6 +1936,7 @@ CommandCost CmdReverseTrainDirection(DoC
 
		}
 
	} 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) {
0 comments (0 inline, 0 general)