Changeset - r4806:68d2726b1b25
[Not reviewed]
master
0 1 0
bjarni - 18 years ago 2006-10-10 17:53:08
bjarni@openttd.org
(svn r6728) -Fix r6651: solved issue where moving rail vehicles in a depot could read from a NULL pointer
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -1134,13 +1134,13 @@ int32 CmdMoveRailVehicle(TileIndex tile,
 
			src_head = UnlinkWagon(src, src_head);
 
			GetLastEnginePart(src)->next = NULL;
 
		}
 

	
 
		if (dst == NULL) {
 
			/* We make a new line in the depot, so we know already that we invalidate the window data */
 
			InvalidateWindowData(WC_VEHICLE_DEPOT, src_head->tile);
 
			InvalidateWindowData(WC_VEHICLE_DEPOT, src->tile);
 

	
 
			// move the train to an empty line. for locomotives, we set the type to TS_Front. for wagons, 4.
 
			if (IsTrainEngine(src)) {
 
				if (!IsFrontEngine(src)) {
 
					// setting the type to 0 also involves setting up the orders field.
 
					SetFrontEngine(src);
0 comments (0 inline, 0 general)